Problem description

Haiku is a genre of Japanese traditional poetry.

A haiku poem consists of 17 syllables split into three phrases, containing 5, 7 and 5 syllables correspondingly (the first phrase should contain exactly 5 syllables, the second phrase should contain exactly 7 syllables, and the third phrase should contain exactly 5 syllables). A haiku masterpiece contains a description of a moment in those three phrases. Every word is important in a small poem, which is why haiku are rich with symbols. Each word has a special meaning, a special role. The main principle of haiku is to say much using a few words.

To simplify the matter, in the given problem we will consider that the number of syllable in the phrase is equal to the number of vowel letters there. Only the following letters are regarded as vowel letters: "a", "e", "i", "o" and "u".

Three phases from a certain poem are given. Determine whether it is haiku or not.

Input

The input data consists of three lines. The length of each line is between 1 and 100, inclusive. The i-th line contains the i-th phrase of the poem. Each phrase consists of one or more words, which are separated by one or more spaces. A word is a non-empty sequence of lowercase Latin letters. Leading and/or trailing spaces in phrases are allowed. Every phrase has at least one non-space character. See the example for clarification.

Output

Print "YES" (without the quotes) if the poem is a haiku. Otherwise, print "NO" (also without the quotes).

Examples

Input

on  codeforces 
beta round is running
a rustling of keys

Output

YES

Input

how many gallons
of edo s rain did you drink
cuckoo

Output

NO
解题思路:只要符合俳句(由“五-七-五”,共十七字音组成,题目要求这些字音是必须都是元音字母)就输出"YES",否则输出"NO",java水过!
AC代码:
 import java.util.Scanner;
public class Main {
final static char[] obk={'a','e','i','o','u'};
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String[] s1=scan.nextLine().split(" ");
String[] s2=scan.nextLine().split(" ");
String[] s3=scan.nextLine().split(" ");
int n1=r(s1,0),n2=r(s2,0),n3=r(s3,0);
if(n1==5&&n2==7&&n3==5)System.out.println("YES");
else System.out.println("NO");
}
public static int r(String[] s,int n){
for(int i=0;i<s.length;++i){
for(int j=0;j<s[i].length();++j){
for(int k=0;k<5;++k)
if(s[i].charAt(j)==obk[k])n++;
}
}
return n;
}
}

最新文章

  1. [ACM_动态规划] 数字三角形(数塔)
  2. 说说设计模式~建造者模式(Builder)
  3. MAC OS下安装Erlang
  4. c# BackGroundWorker 多线程操作的小例子
  5. YEBIS
  6. Oracle -&gt;&gt; TRUNC, ROUND, CEIL, FLOOR
  7. 输出流 写文件 文本 换行nextLine
  8. .Net转前端
  9. 8-6-Exercise
  10. wordpress 404 error on all pages!
  11. C#面试题总结——程序设计基础
  12. 【LeetCode】22. Generate Parentheses (I thought I know Python...)
  13. 【Uva623】500!(高精)
  14. Throwable.异常
  15. 去除Vue在WebStorm中报命名空间的错误
  16. 2015 ICL, Finals, Div. 1 Ceizenpok’s formula(组合数取模,扩展lucas定理)
  17. 5)协程二(yeild from)
  18. laravel 比较好的资料地址 看云
  19. YII2 在使用控制器调试微信接口时报错 Unable to verify your data submission
  20. 人类又被AI碾压,这次是星际争霸

热门文章

  1. mysql5.7初始化密码报错ERROR1820(HY000):YoumustresetyourpasswordusingALTERUSERstateme
  2. 写一个 sum方法,在使用下面任一语法调用时,都可以正常工作
  3. CentOS6.9下NFS配置说明(转载)
  4. 哈夫曼树(Huffman Tree)
  5. How To : Modify ASM SYS password using asmcmd 11g R2 and upper
  6. hstack()与vstack()函数
  7. Dijkstra算法模板
  8. LINQ简记(2):重要概念
  9. Appium Desktop-运行(window+android4.4.2)
  10. springCloud学习-服务链路追踪(Spring Cloud Sleuth)