Mr. Don is an administrator of a famous quiz website named QMACloneClone. The users there can submit their own questions to the system as well as search for question texts with arbitrary queries. This search system employs bi-gram search method.

The bi-gram search method introduces two phases, namely preprocessing and search:

Preprocessing Precompute the set of all the substrings of one or two characters long for each question text.

Search Compute the set for the query string in the same way. Then nd the question texts whose precomputed sets completely contain the set constructed from the query.

Everything looked fine for a while after the feature was released. However, one of the users found an issue: the search results occasionally contained questions that did not include the query string as-is. Those questions are not likely what the users want. So Mr. Don has started to dig into the issue and asked you for help. For each given search query, your task is to find the length of the shortest question text picked up by the bi-gram method but not containing the query text as its substring.

Note

Let's consider the situation that one question text is "CloneQMAC". In this situation, the set computed in the preprocessing phase is {"C", "Cl", "l", "lo", "o", "on", "n", "ne", "e", "eQ", "Q", "QM", "M", "MA", "A", "AC"}.

In the testcase 2, our input text (search query) is "QMAClone". Thus the set computed by the program in the search phase is {"Q", "QM", "M", "MA", "A", "AC", "C", "Cl", "l", "lo", "o", "on", "n", "ne", "e"}.

Since the first set contains all the elements in the second set, the question text "CloneQMAC" is picked up by the program when the search query is "QMAClone" although the text "CloneQ-MAC" itself does not contain the question text "QMAClone". In addition, we can prove that there's no such text of the length less than 9, thus, the expected output for this search query is 9.



Input

The input consists of multiple datasets. A dataset is given as a search query on each line. The input ends with a line containing only a hash sign ("#"), which should not be processed.

A search query consists of no more than 1,000 and non-empty lowercase and/or uppercase letters. The question texts and queries are case-sensitive.

Output

For each search query, print the minimum possible length of a question text causing the issue. If there is no such question text, print "No Results" in one line (quotes only to clarify).

Examples

Input

a
QMAClone
acmicpc
abcdefgha
abcdefgdhbi
abcbcd
#


Output

No Results
9
7
9
12
6


Input

a
QMAClone
acmicpc
abcdefgha
abcdefgdhbi
abcbcd


Output

No Results
9
7
9
12
6
#include <iostream>
#include <fstream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <vector>
using namespace std;

#pragma comment(linker, "/STACK:400000000")

#define EPS 1e-9
#define INF MOD
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(it=X.begin();it!=X.end();it++)
#define iss istringstream
#define ite iterator
#define ll long long
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pi pair<int,int>
#define pb push_back
#define sec second
#define sst stringstream
#define sz size()
#define vc vector
typedef vc<int> vi;
typedef vc<ll> vl;
typedef vc<string> vs;

const int N=128;

string s;
int g[N][N];
int in[N],out[N],E;
int vis[N],twoways;

void dfs(int cur){
	vis[cur]=1;
	rep(i,N)if(!vis[i] && g[cur][i]){
		dfs(i);
	}
}

void go(int cur){
	//cout<<(char)cur<<endl;
	if(E==0)return;
	int successed=0;
	rep(i,N)if(g[cur][i]){
		g[cur][i]=0;
		fill(vis,vis+N,0);
		dfs(i);
		int ok=1;
		//rep(j,N)if(islower(j))cout<<(char)j<<vis[j]<<" ";cout<<endl;
		rep(j,N){
			if(in[j]>0 && !vis[j]){
				//cout<<(char)j<<" "<<in[j]<<endl;
				ok=0;break;
			}
		}
		//cout<<(char)cur<<"->"<<(char)i<<" ("<<E<<") :"<<(ok?"OK":"NG")<<endl;
		if(ok){
			if(successed){
				//cout<<"Found: "<<(char)successed<<endl;
				twoways=1;
				return;
			}
			successed=i;
			in[i]--;
			E--;
			go(i);
		}
		g[cur][i]=1;
		in[i]++;
		E++;
	}
}

int main(){
	while(cin>>s && s!="#"){
		if(s.sz<=2){
			cout<<"No Results\n";
			continue;
		}
		memset(g,0,sizeof(g));
		fill(in,in+N,0);
		fill(out,out+N,0);
		E=0;
		rep(i,s.sz-1){
			g[s[i]][s[i+1]]=1;
		}
		rep(i,N)rep(j,N){
			if(g[i][j]){
				out[i]++,in[j]++,E++;
			}
		}
		int count=0;
		rep(i,N){
			count+=max(0,out[i]-in[i]);
		}
		if(count==0)cout<<E+1<<endl;
		else if(count>1)cout<<E+1+(count-1)<<endl;
		else if(E<s.sz-1)cout<<E+1<<endl;
		else{
			int start=-1;
			rep(i,N){
				if(out[i]-in[i]==1)start=i;
			}
			twoways=0;
			int e=E;
			go(start);
			//cout<<(twoways?"Two":"One")<<endl;
			cout<<(twoways?e+1:e+1+1)<<endl;
		}
	}
}