#include <bits/stdc++.h>
using namespace std;
bool works(int x, string &second) {
  for (int i = x; i < second.length(); i++)
    if (second[i] != second[i - x]) return false;
  return true;
}
int period(string &second) {
  for (int i = 1; i <= second.length(); i++) {
    if (second.length() % i != 0) continue;
    if (works(i, second)) return i;
  }
  return second.length();
}
int main() {
  string second;
  cin >> second;
  if (second.length() % 2 == 1) {
    bool eq = true;
    for (int i = 0; i < second.length(); i++) {
      if (i != second.length() / 2) eq = eq && second[i] == second[0];
    }
    if (eq)
      cout << "Impossible" << endl;
    else {
      cout << 2 << endl;
    }
    return 0;
  }
  int p = period(second);
  if (p == 1) {
    cout << "Impossible" << endl;
  } else {
    if (p % 2) {
      cout << 2 << endl;
    } else {
      cout << 1 << endl;
    }
  }
}
