#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ch = 0;
  int y = -1;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == 'A' || s[i] == 'E' || s[i] == 'I' || s[i] == 'O' ||
        s[i] == 'U' || s[i] == 'Y') {
      ch = max(ch, i - y);
      y = i;
    }
  }
  int t = s.size();
  ch = max(ch, t - y);
  cout << ch;
  return 0;
}
