#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
bool isPal(string s) {
  int n = s.length();
  for (int i = 0; i < n; i++)
    if (s[i] != s[n - 1 - i]) return false;
  return true;
}
int main() {
  string s;
  cin >> s;
  bool allEq = true;
  int n = s.length();
  for (int i = 0; i < n; i++)
    if (n % 2 == 0 || i != n / 2) allEq &= s[0] == s[i];
  if (allEq) {
    cout << "Impossible\n";
    return 0;
  }
  for (int i = 1; i < n - 1; i++) {
    string p = s.substr(i, n - i) + s.substr(0, i);
    if (p == s || !isPal(p)) continue;
    cout << 1 << endl;
    return 0;
  }
  cout << 2 << endl;
  return 0;
}
