#include <bits/stdc++.h>
using namespace std;
signed main() {
  string s;
  long long n;
  cin >> s;
  n = s.size();
  bool okay = false;
  char c = s[0];
  for (long long i = 0; i < n / 2; i++) {
    if (s[i] != c) {
      okay = true;
      break;
    }
  }
  if (!okay) {
    cout << "Impossible\n";
    return 0;
  }
  okay = false;
  for (long long i = 1; i < n; i++) {
    string st = s.substr(i) + s.substr(0, i);
    string ts = st;
    reverse(ts.begin(), ts.end());
    if (st == ts && st != s) {
      okay = true;
      break;
    }
  }
  cout << (okay ? "1\n" : "2\n");
}
