17 lines
280 B
Python
Raw Normal View History

2023-12-01 13:35:13 +01:00
from math import floor
def increaseList(lst, c,m,d):
lst[0] += c
lst[1] += m
lst[2] += d
return lst
n = int(input())
c,m,d = (0,0,0)
for i in range(n):
cmd = [1 if x == "J" else 0 for x in input().split() ]
c,m,d = increaseList(cmd, c,m,d)
print(floor((c+m+d)/3))