#include <bits/stdc++.h>
using namespace std;
int n, a[300004];
string s;
bool canCut(int idx) {
  bool ret = true;
  string w = s.substr(idx, n - idx);
  w += s.substr(0, idx);
  for (int i = 0; i < n; i++)
    if (s[i] != w[i]) ret = false;
  if (ret) return false;
  ret = true;
  for (int i = 0; i < n / 2; i++)
    if (w[i] != w[n - 1 - i]) ret = false;
  return ret;
}
int main() {
  cin >> s;
  n = s.length();
  bool one = true;
  for (int i = 1; i < n / 2; i++)
    if (s[i] != s[i - 1]) one = false;
  if (one) {
    cout << "Impossible";
    return 0;
  }
  for (int i = 1; i < n; i++)
    if (canCut(i)) {
      cout << "1";
      return 0;
    }
  cout << "2";
  return 0;
}
