#include <bits/stdc++.h>
using namespace std;
string n;
int z;
bool candidate_master() {
  for (int i = 1; i < n.length() / 2; i++)
    if (n[i] != n[i - 1]) return false;
  return true;
}
bool palindrome(string x) {
  for (int i = 0; i < x.length() / 2; i++)
    if (x[i] != x[x.length() - i - 1]) return false;
  return true;
}
bool one_cut() {
  for (int i = 1; i < n.length() - 1; i++) {
    string y = "", z = "";
    for (int j = 0; j < i; j++) y += n[j];
    for (int j = i; j < n.length(); j++) z += n[j];
    if (palindrome(z + y) and z + y != n) return true;
  }
  return false;
}
int main() {
  cin >> n;
  if (candidate_master()) {
    cout << "Impossible";
    return 0;
  }
  if (one_cut()) {
    cout << 1;
    return 0;
  }
  cout << 2;
  return 0;
}
