#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using ii = pair<int, int>;
const int oo = 0x3f3f3f3f;
const ll OO = ll(oo) * oo;
const int N = 100005;
int off(int i, int x, int n) {
  int y = i + x;
  if (y < 0) return y + n;
  if (y >= n) return y - n;
  return y;
}
bool isPalin(const string& s) {
  int n = int((s).size());
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != s[n - i - 1]) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = int((s).size());
  if (!(n & 1)) {
    string t = s;
    for (int d = 0; d < n - 1; d++) {
      rotate(t.begin(), t.begin() + 1, t.end());
      if (s != t && isPalin(t)) {
        cout << 1 << '\n';
        return 0;
      }
    }
  }
  bool can = false;
  int i = 0, j = n - 1;
  while (i < j && !can) {
    int q = j;
    bool f = true;
    for (int p = 0; p <= i && f; p++, q++) {
      if (s[p] != s[q]) f = false;
    }
    if (!f) {
      can = true;
    }
    i++;
    j--;
  }
  if (can)
    cout << 2 << '\n';
  else
    cout << "Impossible" << '\n';
  return 0;
}
