#include <bits/stdc++.h>
char s[11100];
bool equ;
int n, le;
inline bool che(int l, int r) {
  equ = 1;
  for (int i = l; i <= r; i++)
    if (s[i] != s[i - l + 1]) {
      equ = 0;
      break;
    }
  if (equ) return 0;
  for (; l < r; l++, r--)
    if (s[l] != s[r]) return 0;
  return 1;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  equ = 1;
  le = n / 2;
  for (int i = 2; i <= le; i++)
    if (s[i] != s[1]) {
      equ = 0;
      break;
    }
  if (equ) {
    printf("Impossible\n");
    return 0;
  }
  for (int i = 1; i <= n - 1; i++) s[i + n] = s[i];
  for (int i = 2; i <= n; i++)
    if (che(i, i + n - 1)) {
      printf("1\n");
      return 0;
    }
  printf("2\n");
  return 0;
}
