#include <bits/stdc++.h>
using namespace std;
bool ispalindrome(string s) {
  for (long long i = 0; i < s.length(); i++)
    if (s[i] != s[s.length() - 1 - i]) return false;
  return true;
}
void solve() {
  string s;
  cin >> s;
  long long n = s.length();
  for (long long int i = 0; i < n; i++) {
    string s1 = s.substr(0, i + 1), s2 = s.substr(i + 1, n - 1 - i);
    if (ispalindrome(s2 + s1) && s2 + s1 != s) {
      cout << 1;
      return;
    }
  }
  for (long long int i = 0; i < n; i++) {
    if (n - 2 * (i + 1) <= 0) break;
    string s1 = s.substr(0, i + 1), s2 = s.substr(i + 1, n - 2 * (i + 1)),
           s3 = s.substr(n - i - 1, i + 1);
    if (ispalindrome(s3 + s2 + s1) && s3 + s2 + s1 != s) {
      cout << 2;
      return;
    }
  }
  cout << "Impossible";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long test_cases = 1;
  for (long long t = 1; t <= test_cases; t++) solve();
  return 0;
}
