#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int maxn = 1e5;
const int INF = 0x7fffffff;
const int mod = 1e9 + 7;
const double eps = 1e-7;
inline int read_int() {
  char c;
  int ret = 0, sgn = 1;
  do {
    c = getchar();
  } while ((c < '0' || c > '9') && c != '-');
  if (c == '-')
    sgn = -1;
  else
    ret = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  return sgn * ret;
}
inline long long read_ll() {
  char c;
  long long ret = 0, sgn = 1;
  do {
    c = getchar();
  } while ((c < '0' || c > '9') && c != '-');
  if (c == '-')
    sgn = -1;
  else
    ret = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  return sgn * ret;
}
bool is_pal(const string& s) {
  for (int i = 0; i < s.size(); ++i)
    if (s[i] != s[s.size() - i - 1]) return false;
  return true;
}
bool is_impossible(const string& s) {
  bool all_same = true;
  int len = s.size();
  char c = s[0];
  for (int i = 1; i < len; ++i) {
    if (s[i] != c) {
      if (len & 1 && i != len / 2) all_same = false;
      if (len % 2 == 0) all_same = false;
    }
  }
  return all_same;
}
string s;
int main() {
  cin >> s;
  if (is_impossible(s)) {
    cout << "Impossible" << endl;
    return 0;
  }
  for (int i = 1; i < s.size(); ++i) {
    string s1 = s.substr(0, i), s2 = s.substr(i, s.size() - i);
    string new_s = s2 + s1;
    if (new_s != s && is_pal(new_s)) {
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 2 << endl;
  return 0;
}
