#include <bits/stdc++.h>
using namespace std;
string s;
string t;
string get(long long b, long long e) {
  string r = "";
  for (long long i = b; i <= e; i++) {
    r += s[i];
  }
  return r;
}
bool chk() {
  for (long long i = 0; i < t.length() / 2; i++) {
    if (t[i] != t[t.length() - i - 1]) return 0;
  }
  return 1;
}
int main() {
  cin >> s;
  long long n = s.length();
  long long k = 3;
  for (long long i = 0; i < n / 2; i++) {
    t = get(i + 1, n - 1) + get(0, i);
    if (chk() && t != s) k = 1;
    t = get(n - 1 - i, n - 1) + get(i + 1, n - 1 - i - 1) + get(0, i);
    if (chk() && t != s) k = min(k, (long long)2);
  }
  if (k == 3)
    cout << "Impossible";
  else
    cout << k;
  return 0;
}
