#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  int n;
  cin >> s;
  n = s.size();
  for (int i = 2; i <= n / 2; i++) {
    string s1 = s.substr(0, i);
    string s2 = s1;
    reverse(s2.begin(), s2.end());
    if (s1 == s2) continue;
    string s3 = s.substr(i, n - i) + s1;
    string s4 = s3;
    reverse(s4.begin(), s4.end());
    if (s3 != s4 || s3 == s) continue;
    return cout << 1, 0;
  }
  for (int i = 2; i <= n / 2; i++) {
    string s1 = s;
    int p = n - 1 - (+i - 1);
    for (int k = 0; k < i; k++) swap(s1[k], s1[k + p]);
    string s3 = s1;
    reverse(s3.begin(), s3.end());
    if (s1 != s && s1 == s3) {
      return cout << 2, 0;
    }
  }
  cout << "Impossible";
}
