#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\t";
  err(++it, args...);
}
template <typename T1, typename T2>
ostream& operator<<(ostream& c, pair<T1, T2>& v) {
  c << "(" << v.first << "," << v.second << ")";
  return c;
}
template <template <class...> class TT, class... T>
ostream& operator<<(ostream& out, TT<T...>& c) {
  out << "{ ";
  for (auto& x : c) out << x << " ";
  out << "}";
  return out;
}
const long long int MOD = 1e9 + 7, LIM = 1e5 + 5;
const long double EPS = 1e-9;
long long int t, n, m, k, x, y;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  n = s.length();
  bool p = 1;
  for (int i = 0; i < n / 2; i++) {
    if (s[i] != s[0]) p = 0;
  }
  if (p)
    cout << "Impossible" << endl;
  else {
    for (int i = 1; i < n; i++) {
      vector<char> v;
      for (int j = i; j < n; j++) v.push_back(s[j]);
      for (int j = 0; j < i; j++) v.push_back(s[j]);
      bool p = 1, q = 1;
      for (int j = 0; j < n; j++) {
        if (v[j] != v[n - 1 - j]) p = 0;
      }
      for (int j = 0; j < n; j++) {
        if (v[j] != s[j]) q = 0;
      }
      if (p == 1 && q == 0) {
        cout << 1 << endl;
        return 0;
      }
    }
    cout << 2 << endl;
  }
  return 0;
}
