#include <bits/stdc++.h>
using namespace std;
void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -f;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  x *= f;
}
void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (!x) return;
  print(x / 10), putchar(x % 10 + 48);
}
void write(int x) {
  if (!x)
    putchar('0');
  else
    print(x);
  putchar('\n');
}
const int maxn = 1e6 + 10;
const int inf = 1e9;
const double eps = 1e-8;
const int mod = 1e9 + 7;
char r[maxn], s[maxn];
int n;
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  int x = 1;
  for (int i = 2; i <= n; i++) {
    if ((n & 1) && i == n / 2 + 1) continue;
    if (s[i] != s[1]) x = 0;
  }
  if (x) return puts("Impossible"), 0;
  for (int i = 1; i <= n / 2; i++) {
    for (int j = i + 1; j <= n; j++) r[j - i] = s[j];
    for (int j = 1; j <= i; j++) r[n - i + j] = s[j];
    int bo = 1, b = 0;
    for (int j = 1; j <= n / 2; j++)
      if (r[j] != r[n - j + 1]) bo = 0;
    for (int j = 1; j <= n; j++)
      if (r[j] != s[j]) b = 1;
    if (bo && b) return puts("1"), 0;
  }
  write(2);
  return 0;
}
