#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
string s, t1[N], t2[N];
bool check(const string& s) {
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != s[s.size() - 1 - i]) return false;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> s;
  for (int i = 0; i < s.size() - 1; i++) {
    if (i == 0)
      t1[i] = s[i];
    else
      t1[i] = t1[i - 1] + s[i];
  }
  for (int i = s.size() - 1; i >= 0; i--) t2[i] = s[i] + t2[i + 1];
  for (int i = 0; i < s.size() - 1; i++) {
    string news = t2[i + 1] + t1[i];
    if (s != news && check(news)) return cout << 1, 0;
  }
  for (int i = 0; i < s.size() / 2; i++)
    if (t1[i] != t2[s.size() - 1 - i]) return cout << 2, 0;
  cout << "Impossible";
}
