#include <bits/stdc++.h>
void out(int x) {
  if (x) {
    std::cout << x << std::endl;
  } else {
    std::cout << "Impossible" << std::endl;
  }
  exit(0);
}
bool string_is_palindorome(const std::string& s) {
  for (int i = 0, j = s.size() - 1; i < j; i++, j--)
    if (s[i] != s[j]) return false;
  return true;
}
int main(int argc, char** argv) {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);
  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);
  std::string s, t;
  std::cin >> s;
  t = s;
  int size = s.size();
  if (size <= 3) out(0);
  for (int i = 1; i < size; i++) {
    std::rotate(std::begin(t), std::begin(t) + 1, std::end(t));
    if (!string_is_palindorome(t)) continue;
    if (t != s) out(1);
  }
  for (int i = 1; i <= size / 2; i++)
    for (int j = 0, k = size - i; j < i; j++, k++) {
      assert(k < size);
      if (s[k] != s[j]) out(2);
    }
  out(0);
  return 0;
}
