#include <bits/stdc++.h>
using namespace std;
int main() {
  int lastPosition = -1;
  int maxDistance = 0;
  string s;
  cin >> s;
  s += "A";
  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') {
      int distance = i - lastPosition;
      if (maxDistance < distance) maxDistance = distance;
      lastPosition = i;
    }
  }
  if (maxDistance == 0) maxDistance = s.size() + 1;
  cout << maxDistance;
  return 0;
}
