#include <bits/stdc++.h>
using namespace std;
string s;
int cnt[26];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  for (int x = (0), qwerty = (int((s).size())); x < qwerty; x++)
    cnt[s[x] - 'a']++;
  int c = 0;
  for (int x = (0), qwerty = (26); x < qwerty; x++) c += cnt[x] / 2 > 0;
  if (c <= 1) {
    cout << "Impossible\n";
    exit(0);
  }
  int ans = 2;
  for (int x = (1), qwerty = (int((s).size())); x < qwerty; x++) {
    bool can = 1;
    string t = s.substr(x) + s.substr(0, x);
    for (int i = (0), qwerty = (int((t).size()) / 2); i < qwerty; i++) {
      can &= t[i] == t[int((t).size()) - 1 - i];
    }
    can &= s != t;
    if (can) ans = 1;
  }
  cout << ans << "\n";
}
