#include <bits/stdc++.h>
using namespace std;
long long llipower(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long llipowerp(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (!a) return b;
  return gcd(b % a, a);
}
long long binarySearch(vector<int> arr, int l, int r, int x) {
  if (r >= l) {
    long long mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
template <typename T>
void printvec(vector<T> inp) {
  for (int i = 0; i < inp.size(); i++) {
    cout << inp[i] << " ";
  }
  cout << "\n";
}
template <typename T>
T ceildiv(T x, T y) {
  return 1 + ((x - 1) / y);
}
long long modInverse(long long a, long long m) {
  long long g = gcd(a, m);
  if (g != 1)
    return -1;
  else
    return llipowerp(a, m - 2, m);
}
void leftrotate(string &s, int d) {
  reverse(s.begin(), s.begin() + d);
  reverse(s.begin() + d, s.end());
  reverse(s.begin(), s.end());
}
bool palindrome(string s) {
  string p = s;
  reverse(p.begin(), p.end());
  return s == p;
}
int main() {
  string inp;
  cin >> inp;
  int n = inp.size();
  bool con = true;
  for (int i = 0; i < n / 2; i++) {
    if (inp[i] != inp[0]) {
      con = false;
      break;
    }
  }
  if (con) {
    cout << "Impossible"
         << "\n";
  } else {
    string org = inp;
    for (int i = 1; i < n; i++) {
      leftrotate(inp, 1);
      if (inp != org && palindrome(inp)) {
        cout << 1 << "\n";
        return 0;
      }
    }
    cout << 2 << "\n";
  }
}
