#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  string s;
  cin >> s;
  int n = s.length();
  if (count(s.begin(), s.end(), s[0]) == n ||
      (n % 2 == 1 && count(s.begin(), s.end(), s[0]) == n - 1)) {
    cout << "Impossible\n";
    return 0;
  }
  for (int i = 1; i < n; ++i) {
    string s2 = s.substr(i, n - i) + s.substr(0, i);
    string s3 = s2;
    reverse(s3.begin(), s3.end());
    if (s2 == s3 && s2 != s) {
      cout << "1\n";
      return 0;
    }
  }
  cout << "2\n";
  return 0;
}
