#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 5;
const double PI = acos(-1.0);
string s;
int main() {
  cin >> s;
  int len = s.length();
  int geti = 0;
  for (int i = (1); i <= (len - 1); ++i) {
    if (s[i] != s[i - 1]) {
      geti = i;
      break;
    }
    geti = i;
  }
  int ans = 2;
  if (geti == len - 1 || (len % 2 && geti == (len - 1) / 2))
    ans = 0;
  else {
    for (int del = (1); del <= (len - 1); ++del) {
      int t = 0, r = len - 1;
      int ispld = 1;
      while (t <= r) {
        int tt = (t + del) % len, rr = (r + del) % len;
        if (s[tt] != s[rr]) {
          ispld = 0;
          break;
        }
        t++, r--;
      }
      if (ispld) {
        int ok = 0;
        for (int i = (0); i <= (len - 1); ++i) {
          if (s[i] != s[(i + del) % len]) {
            ok = 1;
            break;
          }
        }
        if (ok) {
          ans = 1;
          break;
        }
      }
    }
  }
  if (ans == 0)
    puts("Impossible");
  else
    cout << ans << endl;
}
