#include <bits/stdc++.h>
using namespace std;
string o;
int aaa(string a, int s, string x) {
  a += x;
  int i = s;
  int j = a.size() - 1;
  while (i < j) {
    if (a[i] != a[j]) return 0;
    i++;
    j--;
  }
  i = s;
  int f = 0;
  while (i < a.size()) {
    if (a[i] != o[i - s]) f = 1;
    i++;
  }
  return f;
}
int bbb(string x) {
  int i = 0, j = x.size() - 1;
  while (i < j) {
    if (x[i] != x[j]) return 0;
    i++;
    j--;
  }
  return 1;
}
int main() {
  string s;
  cin >> s;
  int i;
  string x = "";
  o = s;
  int f = 0;
  for (i = 0; i < s.size(); i++) {
    x += s[i];
    if (aaa(s, i + 1, x)) {
      cout << 1;
      return 0;
    }
  }
  x = "";
  for (i = 0; i < s.size(); i++) {
    x += s[i];
    if (!bbb(x)) {
      if (i <= s.size() / 2 - 1) {
        cout << 2;
        return 0;
      }
    }
  }
  cout << "Impossible";
  return 0;
}
