#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  bool can = false;
  for (int i = 0; i < n / 2 - 1; ++i) {
    if (s[i] != s[i + 1]) can = true;
  }
  if (!can) {
    cout << "Impossible\n";
    return 0;
  }
  for (int t = 0; t < n - 1; ++t) {
    string x = s.substr(t + 1, n - t - 1) + s.substr(0, t + 1);
    bool ok = true;
    for (int i = 0, j = n - 1; i < j; ++i, --j) {
      if (x[i] != x[j]) {
        ok = false;
        break;
      }
    }
    if (ok && x != s) {
      cout << "1\n";
      return 0;
    }
  }
  cout << "2\n";
}
