#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
ostream &operator<<(ostream &os, pair<S, T> p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> v) {
  os << "[";
  for (int i = 0; i < int((v).size()); i++) os << v[i] << " ";
  return os << "]";
}
long long INF = (1ll << 61);
bool pal(string &s, int n) {
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != s[n - i - 1]) return 0;
  }
  return 1;
}
bool same(string &s, int n) {
  char c = s[0];
  for (int i = 1; i < n; i++) {
    if (c != s[i]) return 0;
  }
  return 1;
}
int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  if (count(s.begin(), s.end(), s[0]) == int((s).size())) {
    cout << "Impossible\n";
    return 0;
  } else if (int((s).size()) % 2 == 1 &&
             count(s.begin(), s.end(), s[0]) == int((s).size()) - 1) {
    cout << "Impossible\n";
    return 0;
  }
  string tmp = s;
  for (int i = 0; i < int((s).size()); i++) {
    rotate(tmp.begin(), tmp.begin() + 1, tmp.end());
    if (pal(tmp, int((tmp).size())) && tmp != s) {
      cout << 1 << endl;
      return 0;
    }
  }
  cout << 2 << endl;
  return 0;
}
