#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 6;
const int MOD = 30013;
bool dzn(char k) {
  if (k == 'a' || k == 'o' || k == 'i' || k == 'u' || k == 'e') return true;
  return false;
}
map<pair<int, int>, long long> mp;
bool pal(string k) {
  string tt = k;
  reverse(tt.begin(), tt.end());
  if (tt == k) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.length();
  bool mb = true;
  for (int i = 0; i < (n / 2); ++i) {
    if (s[i] != s[0]) mb = false;
  }
  if (mb) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = 0; i < (n); ++i) {
    string a1, a2;
    for (int j = 0; j < (i + 1); ++j) {
      a1 += s[j];
    }
    for (int j = (i + 1); j <= (n - 1); ++j) {
      a2 += s[j];
    }
    string an = a2 + a1;
    if (pal(an) && an != s) {
      cout << 1 << endl;
      return 0;
    }
  }
  string t;
  string v;
  for (int i = 0; i < (n); ++i) {
    if (i >= n - i - 1) break;
    t += s[i];
    v += s[n - i - 1];
    if (t == v) {
      reverse(v.begin(), v.end());
      if (t != v) {
        cout << 2 << endl;
        return 0;
      }
      reverse(v.begin(), v.end());
    }
  }
  if (n % 2)
    cout << 4 << endl;
  else
    cout << 3 << endl;
  return 0;
}
