#include <bits/stdc++.h>
using ll = long long;
using std::cin;
using std::cout;
using std::endl;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;
void fail() {
  cout << "Impossible"
       << "\n";
  exit(0);
}
bool palindrome(const std::string& s) {
  int l = 0;
  int r = (int)s.size() - 1;
  while (l <= r) {
    if (s[l] == s[r]) {
      l++;
      r--;
    } else {
      return false;
    }
  }
  return true;
}
int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  std::string s;
  cin >> s;
  const int n = (int)s.size();
  if (n & 1) {
    std::string p = s.substr(0, n / 2);
    std::string q = s.substr(n / 2 + 1, n / 2);
    if (p == std::string(n / 2, p[0])) fail();
    cout << 2 << "\n";
  } else {
    if (s == std::string(n, s[0])) fail();
    int res = 2;
    for (int i = 1; i < n; ++i) {
      const std::string p = s.substr(i, n - i) + s.substr(0, i);
      if (s != p and palindrome(p)) {
        chmin(res, 1);
      }
    }
    cout << res << "\n";
  }
  return 0;
}
