#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  string vowels = "AEIOUY";
  cin >> s;
  int n = s.length();
  int a[100];
  int i, j, k = 0, mn = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < 6; j++)
      if (s[i] == vowels[j]) a[k++] = i;
  }
  if (k == 0)
    mn = n + 1;
  else {
    for (i = 0; i < k - 1; i++) {
      if (mn < a[i + 1] - a[i]) mn = a[i + 1] - a[i];
    }
    if (n - a[k - 1] > mn) mn = n - a[k - 1];
    if (mn == 0) mn++;
    mn = max(mn, a[0] + 1);
  }
  cout << mn << endl;
  return 0;
}
