n=int(input())
z=0
for i in range(n):
S=input()
for i in range (len(S)):
if S[i]=="A":
z+=4
elif S[i]=="K":
z+=3
elif S[i]=="Q":
z+=2
elif S[i]=="J":
z+=1
print(z)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
3300 KB |
Output is correct |
2 |
Correct |
25 ms |
3300 KB |
Output is correct |
3 |
Correct |
26 ms |
3300 KB |
Output is correct |
4 |
Correct |
29 ms |
3428 KB |
Output is correct |
5 |
Correct |
27 ms |
3300 KB |
Output is correct |
6 |
Correct |
30 ms |
3432 KB |
Output is correct |
7 |
Correct |
34 ms |
3300 KB |
Output is correct |
8 |
Correct |
38 ms |
3300 KB |
Output is correct |
9 |
Correct |
64 ms |
3400 KB |
Output is correct |
10 |
Correct |
77 ms |
3528 KB |
Output is correct |