#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(time(0));
bool isPrime(long long a) {
  long long i;
  for (i = 2; i * i <= a; i++) {
    if (a % i == 0) {
      return 0;
    }
  }
  return (a != 1);
}
bool isPalindrom(const string &s, int l, int r) {
  for (int i = 0; i < (r - l + 1) / 2; i++) {
    if (s[l + i] != s[r - i]) {
      return 0;
    }
  }
  return 1;
}
template <class type1>
type1 gcd(type1 a, type1 b) {
  type1 t;
  while (b) {
    t = b;
    b = a % b;
    a = t;
  }
  return a;
}
long long positiveMod(long long v, long long md) {
  v = v % md;
  if (v < 0) {
    v += md;
  }
  return v;
}
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, i, j, a, b, c;
  cin >> s;
  n = s.size();
  for (i = 0; i < n / 2; i++) {
    if (s[i] != s[0]) {
      break;
    }
  }
  if (i == n / 2) {
    cout << "Impossible\n";
    return 0;
  }
  for (i = 0; i < n / 2; i++) {
    string ts = "";
    for (j = i + 1; j < n; j++) {
      ts += s[j];
    }
    for (j = 0; j <= i; j++) {
      ts += s[j];
    }
    if (isPalindrom(ts, 0, n - 1) && ts != s) {
      cout << 1;
      return 0;
    }
  }
  cout << 2;
  return 0;
}
