#include <bits/stdc++.h>
using namespace std;
int main() {
  string w, a = "AEIOUY";
  getline(cin, w);
  int n, kol = w.size() + 1, x1 = -1;
  cin >> n;
  for (int i = 0; i < w.size(); i++) {
    if (a.find(w[i]) != string::npos) {
      if (x1 < 0) {
        x1 = i;
        kol = i + 1;
        continue;
      }
      kol = max(i - x1, kol);
      x1 = i;
    }
  }
  kol = max((int)w.size() - x1, kol);
  cout << kol;
  return 0;
}
