#include <bits/stdc++.h>
using namespace std;
bool ispalin(string str) {
  int len = str.length();
  for (int i = 0; i < len / 2; ++i)
    if (str[i] != str[len - 1 - i]) return false;
  return true;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string str;
  cin >> str;
  int len = str.length();
  bool check = true;
  for (int i = 1; i < len / 2; ++i) {
    if (str[i] != str[i - 1]) check = false;
  }
  if (check) {
    cout << "Impossible";
    return 0;
  }
  for (int i = 0; i < len / 2; ++i) {
    string temp = str.substr(i + 1) + str.substr(0, i + 1);
    if (temp != str) {
      if (ispalin(temp)) {
        cout << 1;
        return 0;
      }
    }
  }
  cout << 2;
  return 0;
}
