#include <bits/stdc++.h>
using namespace std;
string s;
string t;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> s;
  int n = s.length();
  s = '0' + s;
  int qq = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] != s[1]) qq++;
  }
  if (qq <= 1) {
    cout << "Impossible";
    return 0;
  }
  for (int i = 2; i <= n; i++) {
    t.clear();
    t = '0';
    for (int j = i; j <= n; j++) t += s[j];
    for (int j = 1; j <= i - 1; j++) t += s[j];
    bool q = 1;
    for (int j = 1; j <= n / 2; j++) {
      if (t[j] != t[n + 1 - j]) {
        q = 0;
        break;
      }
    }
    if (q == 0) {
      continue;
    }
    q = 0;
    for (int j = 1; j <= n; j++) {
      if (t[j] != s[j]) {
        q = 1;
        break;
      }
    }
    if (q) {
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 2 << endl;
  return 0;
}
