#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e4 + 10;
string s;
string t;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  int mark = 1;
  int tmo = s.size() / 2;
  tmo--;
  for (int i = 0; i <= tmo; ++i) {
    if (s[i] != s[0]) {
      mark = 0;
      break;
    }
  }
  if (mark) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = 1; i < s.size(); ++i) {
    t = s.substr(i) + s.substr(0, i);
    if (t != s) {
      int l = 0, r = s.size() - 1;
      int flag = 1;
      while (l <= r) {
        if (t[l++] != t[r--]) {
          flag = 0;
          break;
        }
      }
      if (flag) {
        cout << 1 << endl;
        return 0;
      }
    }
  }
  cout << 2 << endl;
  return 0;
}
