import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
public class Main {
public static void main
(String[] args
) { romaInit();
HashMap
<String, Integer
> m
= new HashMap
<String, Integer
>(); try {
while (true) {
String line
= reader.
readLine(); if (line == null) {
break;
}
String[] tokens
= line.
split(" "); for (int i = 0; i < tokens.length; i++) {
if (isRomaString(token)) {
if (m.containsKey(token)) {
m.put(token, m.get(token) + 1);
} else {
m.put(token, 1);
}
}
}
}
}
System.
out.
println(s
+ " : " + m.
get(s
)); }
}
static HashMap
<String, Boolean
> roma
= new HashMap
<String, Boolean
>();
static void romaInit() {
roma.put("a", true);
roma.put("ba", true);
roma.put("be", true);
roma.put("bi", true);
roma.put("bo", true);
roma.put("bu", true);
roma.put("bya", true);
roma.put("byo", true);
roma.put("byu", true);
roma.put("cha", true);
roma.put("chi", true);
roma.put("cho", true);
roma.put("chu", true);
roma.put("da", true);
roma.put("de", true);
roma.put("di", true);
roma.put("do", true);
roma.put("du", true);
roma.put("dya", true);
roma.put("dyo", true);
roma.put("dyu", true);
roma.put("e", true);
roma.put("fu", true);
roma.put("ga", true);
roma.put("ge", true);
roma.put("gi", true);
roma.put("go", true);
roma.put("gu", true);
roma.put("gwa", true);
roma.put("gya", true);
roma.put("gyo", true);
roma.put("gyu", true);
roma.put("ha", true);
roma.put("he", true);
roma.put("hi", true);
roma.put("ho", true);
roma.put("hu", true);
roma.put("hya", true);
roma.put("hyo", true);
roma.put("hyu", true);
roma.put("i", true);
roma.put("ja", true);
roma.put("ji", true);
roma.put("jo", true);
roma.put("ju", true);
roma.put("ka", true);
roma.put("ke", true);
roma.put("ki", true);
roma.put("ko", true);
roma.put("ku", true);
roma.put("kwa", true);
roma.put("kya", true);
roma.put("kyo", true);
roma.put("kyu", true);
roma.put("m", true);
roma.put("ma", true);
roma.put("me", true);
roma.put("mi", true);
roma.put("mo", true);
roma.put("mu", true);
roma.put("mya", true);
roma.put("myo", true);
roma.put("myu", true);
roma.put("n", true);
roma.put("na", true);
roma.put("ne", true);
roma.put("ni", true);
roma.put("no", true);
roma.put("nu", true);
roma.put("nya", true);
roma.put("nyo", true);
roma.put("nyu", true);
roma.put("o", true);
roma.put("pa", true);
roma.put("pe", true);
roma.put("pi", true);
roma.put("po", true);
roma.put("pu", true);
roma.put("pya", true);
roma.put("pyo", true);
roma.put("pyu", true);
roma.put("ra", true);
roma.put("re", true);
roma.put("ri", true);
roma.put("ro", true);
roma.put("ru", true);
roma.put("rya", true);
roma.put("ryo", true);
roma.put("ryu", true);
roma.put("sa", true);
roma.put("se", true);
roma.put("sha", true);
roma.put("shi", true);
roma.put("sho", true);
roma.put("shu", true);
roma.put("si", true);
roma.put("so", true);
roma.put("su", true);
roma.put("sya", true);
roma.put("syo", true);
roma.put("syu", true);
roma.put("ta", true);
roma.put("te", true);
roma.put("ti", true);
roma.put("to", true);
roma.put("tsu", true);
roma.put("tu", true);
roma.put("tya", true);
roma.put("tyo", true);
roma.put("tyu", true);
roma.put("u", true);
roma.put("w", true);
roma.put("wa", true);
roma.put("wo", true);
roma.put("ya", true);
roma.put("yo", true);
roma.put("yu", true);
roma.put("za", true);
roma.put("ze", true);
roma.put("zi", true);
roma.put("zo", true);
roma.put("zu", true);
roma.put("zya", true);
roma.put("zyo", true);
roma.put("zyu", true);
}
static boolean isRomaString
(String s
) { if (s.length() < 1) {
return false;
}
int i = 0;
int j = 0;
while (i < s.length()) {
while (j < s.length()) {
if (isBoin(s.charAt(j))) {
break;
}
j++;
}
if (j < s.length()) {
b = s.substring(i, j + 1);
} else {
b = s.substring(i);
}
if (!roma.containsKey(b.toLowerCase())) {
return false;
}
i = j + 1;
j = j + 1;
}
return true;
}
static boolean isBoin(char c) {
switch (c) {
case 'a':
case 'i':
case 'u':
case 'e':
case 'o':
case 'n':
return true;
default:
return false;
}
}
}
/*
ローマ字 - Wikipedia
http://j...content-available-to-author-only...a.org/wiki/%E3%83%AD%E3%83%BC%E3%83%9E%E5%AD%97
romaInit関数はこのページのローマ字をコピペして正規表現で整形してソースコードに貼り付けました。
改行で区切られた文字列を読み取り、それをスペースで分割して単語を読み取り、それを母音aiueoとnで
音に分割します。音とローマ字との照合を行い、単語に含まれる全部の音がローマ字に合致したら
その単語はローマ字表記であると判断するようにしました。超がんばりました。わたしにはこれが限界です。
*/
aW1wb3J0IGphdmEuaW8uQnVmZmVyZWRSZWFkZXI7CmltcG9ydCBqYXZhLmlvLkZpbGVJbnB1dFN0cmVhbTsKaW1wb3J0IGphdmEuaW8uRmlsZU5vdEZvdW5kRXhjZXB0aW9uOwppbXBvcnQgamF2YS5pby5JT0V4Y2VwdGlvbjsKaW1wb3J0IGphdmEuaW8uSW5wdXRTdHJlYW1SZWFkZXI7CmltcG9ydCBqYXZhLnV0aWwuSGFzaE1hcDsKCnB1YmxpYyBjbGFzcyBNYWluIHsKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZ1tdIGFyZ3MpIHsKCQlyb21hSW5pdCgpOwoJCUhhc2hNYXA8U3RyaW5nLCBJbnRlZ2VyPiBtID0gbmV3IEhhc2hNYXA8U3RyaW5nLCBJbnRlZ2VyPigpOwoJCXRyeSB7CgkJCUJ1ZmZlcmVkUmVhZGVyIHJlYWRlciA9IG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIobmV3IEZpbGVJbnB1dFN0cmVhbSgi44OL44Ob44OzLnR4dCIpKSk7CgkJCXdoaWxlICh0cnVlKSB7CgkJCQlTdHJpbmcgbGluZSA9IHJlYWRlci5yZWFkTGluZSgpOwoJCQkJaWYgKGxpbmUgPT0gbnVsbCkgewoJCQkJCWJyZWFrOwoJCQkJfQoJCQkJU3RyaW5nW10gdG9rZW5zID0gbGluZS5zcGxpdCgiICIpOwoJCQkJZm9yIChpbnQgaSA9IDA7IGkgPCB0b2tlbnMubGVuZ3RoOyBpKyspIHsKCQkJCQlTdHJpbmcgdG9rZW4gPSB0b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