#include <bits/stdc++.h>
using namespace std;
string s, t;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> s;
  bool ok = false;
  for (int i = 1; i < s.length() / 2; i++)
    if (s[0] != s[i]) ok = true;
  if (!ok) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = 0; i < s.length() / 2; i++) {
    string t = "";
    for (int j = i + 1; j < s.length(); j++) t += s[j];
    for (int j = 0; j <= i; j++) t += s[j];
    bool palindrome = true;
    for (int j = 0; palindrome && j < t.length() / 2; j++)
      if (t[j] != t[t.length() - 1 - j]) palindrome = 0;
    if (palindrome && s != t) {
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 2 << endl;
  return 0;
}
