#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename Arg1>
void debug(const char* name, Arg1&& arg1) {
  cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void debug(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " = " << arg1;
  debug(comma, args...);
}
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool pallindrome(string& s) {
  long long n = s.length();
  for (long long i = 0; i < n / 2; ++i)
    if (s[i] != s[n - 1 - i]) return 0;
  return 1;
}
int32_t main() {
  c_p_c();
  string s;
  cin >> s;
  long long n = s.length();
  long long cnt = 1;
  for (long long i = 1; i < n; ++i)
    if (s[i] == s[0]) cnt++;
  if ((n & 1 && cnt >= (n - 1)) || (n % 2 == 0 && cnt == n)) {
    cout << "Impossible\n";
    return 0;
  }
  for (long long i = 1; i < n; ++i) {
    string agla = s.substr(i, n - i);
    string st = s.substr(0, n - i);
    if (agla == st) continue;
    agla += s.substr(0, i);
    if (pallindrome(agla)) {
      cout << 1 << '\n';
      return 0;
    }
  }
  cout << 2 << '\n';
  return 0;
}
