#include <bits/stdc++.h>
using namespace std;
int main() {
  string out[] = {"NO", "YES"};
  int a[4] = {};
  for (int i = 1; i <= 3; i++) {
    string line, se;
    getline(cin, line);
    stringstream str(line);
    while (str >> se) {
      for (char c : se) {
        a[i] += (set<char>{'a', 'e', 'i', 'o', 'u'}.count(c));
      }
    }
  }
  cout << out[a[1] == 5 && a[2] == 7 && a[3] == 5] << '\n';
}
