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 <bits/stdc++.h>

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

int c2i(char c) {
  return isupper(c) ? c-'A' : c-'a'+26;
}

char i2c(int i) {
  return i < 26 ? i+'A' : i-26+'a';
}

const int n = 52;
int G[n][n];
bool used[1000];
vector<char> path;
void dfs(int u, int& cnt, int e, const int& E) {
  if(e == E) {
    //rep(i, path.size()) cout << path[i] << " ";
    //cout << endl;
    ++cnt;
    return;
  }
  for(int v = 0; v < n; ++v) {
    if(G[u][v] != -1 && !used[G[u][v]]) {
      used[G[u][v]] = true;
      //path.push_back(i2c(v));
      dfs(v, cnt, e+1, E);
      //path.pop_back();
      used[G[u][v]] = false;
      if(cnt >= 2) return;
    }
  }
}

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  string s;
  while(cin >> s, s != "#") {
    int len = s.size();
    if(len <= 2) {
      cout << "No Results" << endl;
      continue;
    }

    fill(G[0], G[n], -1);
    int E = 0;
    vint in(n, 0), out(n, 0);
    rep(i, len-1) {
      int from = c2i(s[i]), to = c2i(s[i+1]);
      if(G[from][to] == -1) {
	G[from][to] = E++;
	++out[from];
	++in[to];
      }
    }
    int D = 0;
    rep(i, n) D += max(0ll, in[i]-out[i]);
    if(D == 0) cout << E+1 << endl;
    else if(D != 1) cout << E+D << endl;
    else if(E+1 < len) cout << E+1 << endl;
    else {
      fill(used, used+E, false);
      int cnt = 0;
      //path.push_back(s[0]);
      dfs(c2i(s[0]), cnt, 0, E);
      //path.pop_back();
      if(cnt == 2) cout << E+1 << endl;
      else cout << E+2 << endl;
    }
  }

  return 0;
}

