1
 2
 3
 4
 5
 6
 7
 8
 9
10
n = int(input())
s = input()

b = n//10

r = 0
for i in range(0, n, b):
    r += s[i:i + b].count('T') == b

print(r)