#include <bits/stdc++.h>
using namespace std;
int solve(const string& s, int len) {
  for (int i = 0; i < len / 2; ++i) {
    if (s[i] != s[len - i - 1]) return 0;
  }
  bool impossible = true;
  for (int i = 1; i < len / 2; ++i) {
    if (s[0] != s[i]) {
      impossible = false;
      break;
    }
  }
  if (impossible) {
    return -1;
  }
  if (len % 2 == 0) {
    int sol = solve(s, len / 2);
    if (sol == 0 || sol == 1) return 1;
  }
  return 2;
}
int main() {
  string s;
  getline(cin, s);
  int sol = solve(s, s.length());
  switch (sol) {
    case -1:
      cout << "Impossible\n";
      break;
    default:
      cout << sol << endl;
  }
  return 0;
}
