#include <bits/stdc++.h>
using namespace std;
signed main() {
  string second;
  cin >> second;
  int diff = 0;
  int n = (int)second.size();
  for (int i = 1; i < n; i++) {
    if (second[i] != second[0]) {
      diff++;
    }
  }
  if (diff <= 1) {
    cout << "Impossible\n";
    return 0;
  }
  for (int i = 1; i < n; i++) {
    string news = second.substr(i, n - i) + second.substr(0, i);
    if (news == second) {
      continue;
    }
    bool ok = 1;
    for (int j = 0; j < n / 2; j++) {
      if (news[j] != news[n - j - 1]) {
        ok = 0;
        break;
      }
    }
    if (ok) {
      cout << "1\n";
      return 0;
    }
  }
  cout << "2\n";
  return 0;
}
