#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> s;
  bool f = false;
  for (int i = 0; i < s.size() / 2; i++)
    if (s[0] != s[i] or s[0] != s[s.size() - i - 1]) {
      f = true;
      break;
    }
  if (!f) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = 1; i < s.size() - 1; i++) {
    string v = s.substr(i, s.size() - i) + s.substr(0, i);
    string w = v;
    reverse(w.begin(), w.end());
    if (v == w and v != s) {
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 2 << endl;
  return 0;
}
