1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n = int(input())
tests = input()

points = 0
group_size = int(n / 10)

for i in range(0, 10):
    start = group_size * i
    end = group_size * (i + 1)
    if tests[start:end].count('T') == group_size:
        points = points + 1

print(points)