#include <bits/stdc++.h>
using namespace std;
bool is_palindrome(string &s, int l, int r) {
  while (l < r && s[l] == s[r]) {
    l++;
    r--;
  }
  if ((r - l + 1) & 1)
    return l == r;
  else
    return l - 1 == r;
}
const int INF = 1e9;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int l = 0, r = s.size() - 1;
  int ans = INF;
  while (l < r) {
    if (!is_palindrome(s, 0, l)) {
      if (s.size() & 1)
        ans = min(ans, 2);
      else {
        ans = min(ans, 2);
      }
    }
    l++;
    r--;
  }
  int n = s.size();
  for (int i = 0; i < n - 1; i++) {
    string q = s.substr(0, i + 1);
    string z = s.substr(i + 1, n - i - 1);
    string t = z + q;
    if (is_palindrome(t, 0, n - 1) && t != s) ans = min(ans, 1);
  }
  if (ans == INF)
    cout << "Impossible";
  else
    cout << ans;
  return 0;
}
