#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int lens = s.length();
  s = " " + s;
  s = s + " ";
  int minn = -1;
  int a[10000] = {0};
  a[0] = 0;
  int p = 1;
  for (int i = 0; i <= lens + 1; i++) {
    if (s[i] == 'A' || s[i] == 'E' || s[i] == 'I' || s[i] == 'O' ||
        s[i] == 'U' || s[i] == 'Y') {
      a[p++] = i;
    }
  }
  a[p++] = lens + 1;
  for (int i = 0; i < p; i++) {
    a[i] = a[i + 1] - a[i];
    minn = max(a[i], minn);
  }
  cout << minn << endl;
}
