#include <bits/stdc++.h>
using namespace std;
long long maxi = LLONG_MIN;
long long mini = LLONG_MAX;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long INFll = 1ll * 1000000000 * 1000000000;
const long double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
long long t, i, j, k, n, temp, flag, ans, m;
bool ispalin(string s) {
  long long n = s.length();
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != s[n - i - 1]) {
      return false;
    }
  }
  return true;
}
int main() {
  string s;
  cin >> s;
  n = s.length();
  long long flag = 1;
  for (i = 1; i < n; i++) {
    if (s[i] != s[0]) flag = 0;
  }
  if (flag == 1 || n <= 3) {
    cout << "Impossible";
    return 0;
  }
  for (i = 1; i < n - 1; i++) {
    string left = s.substr(i, n - i);
    string right = s.substr(0, i);
    if ((ispalin(left + right) && (left + right) != s) ||
        (ispalin(right + left) && (right + left) != s)) {
      cout << 1;
      return 0;
    }
  }
  for (i = 0; i < n / 2; i++) {
    string r = s.substr(0, i + 1);
    if (!ispalin(r)) {
      cout << 2;
      return 0;
    }
  }
  cout << "Impossible";
  return 0;
}
