#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 10;
char str[maxn];
int len;
bool isHui(int mov) {
  int lo = 0, hi = len - 1;
  while (lo < hi) {
    if (str[(lo + mov) % len] != str[(hi + mov) % len]) return 0;
    --hi, ++lo;
  }
  return 1;
}
bool isSame(int mov) {
  for (int i = 0; i < len; ++i) {
    if (str[i] != str[(i + mov) % len]) return 0;
  }
  return 1;
}
int main() {
  scanf("%s", str);
  len = strlen(str);
  if (len == 1 || len == 2 || len == 3) {
    puts("Impossible");
    return 0;
  }
  {
    bool flag = 0;
    char tag = str[0];
    int lo = 0, hi = len - 1;
    while (lo < hi) {
      if (str[lo] != tag || str[hi] != tag) {
        flag = 1;
        break;
      }
      --hi, ++lo;
    }
    if (!flag) {
      puts("Impossible");
      return 0;
    }
  }
  for (int i = 0; i < len; ++i) {
    if (isSame(i) == false && isHui(i)) {
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 2 << endl;
  return 0;
}
