#include <bits/stdc++.h>
using namespace std;
const int Inf = (1 << 30) - 1;
const long long lInf = (1LL << 62) - 1;
int n;
string str;
bool check(string s) {
  for (int i = 1; i <= n; ++i)
    if (s[i] != s[n - i + 1]) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  bool flag = 1;
  cin >> str;
  n = str.size();
  str = " " + str;
  for (int i = 1; i <= n; ++i)
    if (n % 2 == 0 || i != n / 2 + 1) flag &= (str[1] == str[i]);
  if (flag) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    string s = " " + str.substr(i + 1, n - i) + str.substr(1, i);
    if (s != str && check(s)) {
      cout << "1" << endl;
      return 0;
    }
  }
  cout << "2" << endl;
  return 0;
}
