164342025-04-30 09:21:39horkaKvázi-Izogrampypy3Accepted 100/100104ms23272 KiB
n=int(input())
ans=0
for i in range(n):
    l=input()
    s=l.split(" ")
    cnt=[]
    for x in range(26):
        cnt.append(0)
    for x in s:
        for c in x:
            if(ord(c)>=ord('A') and ord(c)<=ord('Z')):
                 cnt[ord(c)-ord('A')]+=1
            elif (ord('a')<=ord(c) and ord(c)<=ord('z')):
                cnt[ord(c)-ord('a')]+=1
    ok=1
    for x in cnt:
        if(x>2):
            ok=0
    ans+=ok
print(ans)
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted39ms19436 KiB
2Accepted43ms19584 KiB
subtask230/30
3Accepted39ms19492 KiB
4Accepted56ms21624 KiB
5Accepted59ms21616 KiB
6Accepted67ms22516 KiB
7Accepted79ms22756 KiB
subtask350/50
8Accepted52ms21696 KiB
9Accepted52ms21464 KiB
10Accepted61ms21668 KiB
11Accepted59ms21552 KiB
12Accepted54ms21736 KiB
13Accepted63ms21644 KiB
subtask420/20
14Accepted81ms22692 KiB
15Accepted82ms22928 KiB
16Accepted79ms22796 KiB
17Accepted85ms23096 KiB
18Accepted90ms23272 KiB
19Accepted93ms23272 KiB
20Accepted104ms23268 KiB