ans = 0 local n = io.read("*n", "*l") for i = 1, n do local s1, s2, s3, s4 = io.read():match("(%w+) (%w+) (%w+) (%w+)") local t = {s1, s2, s3, s4} table.sort(t) if t[1] == "akai" and t[2] == "marui" and t[3] == "okii" and t[4] == "umai" then ans = ans + 1 end end print(ans)