#include <bits/stdc++.h>
using namespace std;
bool palindrom(string s) {
  int n = s.size();
  for (int i = 0; i < n; i++)
    if (s[i] != s[n - i - 1]) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  int n = s.size();
  bool flag = 1;
  for (int i = 1; i < n / 2; i++)
    if (s[i - 1] != s[i]) flag = 0;
  if (flag) return cout << "Impossible\n", 0;
  for (int i = 1; i < n; i++) {
    string ss = s.substr(i, n) + s.substr(0, i);
    if (ss != s && palindrom(ss)) return cout << 1 << "\n", 0;
  }
  return cout << 2 << "\n", 0;
  return 0;
}
