#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int cc = 0;
  for (int i = 0; i < n / 2; ++i) cc += (s[i] != s[0]);
  if (cc == 0) {
    cout << "Impossible" << endl;
  } else if (n % 2) {
    cout << 2 << endl;
  } else {
    int ok = 0;
    for (int i = 0; i < n / 2; ++i) {
      string t = s.substr(i + 1) + s.substr(0, i + 1);
      string a = t.substr(0, n / 2);
      string b = t.substr(n / 2);
      reverse(b.begin(), b.end());
      if (s != t && a == b) {
        ok = 1;
        break;
      }
    }
    if (ok)
      cout << "1" << endl;
    else
      cout << "2" << endl;
  }
  return 0;
}
