#include <bits/stdc++.h>
using namespace std;
int n, cnt;
string s, r, t;
int main() {
  cin >> s;
  n = s.size();
  for (int i = 0; i < n / 2; ++i) cnt += s[i] != s[0];
  if (!cnt) return puts("Impossible"), 0;
  if (n % 2 == 1) return puts("2"), 0;
  for (int i = 1; i <= n / 2; ++i) {
    t = s.substr(i, n) + s.substr(0, i);
    r = t;
    reverse(r.begin(), r.end());
    if (t == r && t != s) return puts("1"), 0;
  }
  printf("2\n");
  return 0;
}
