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

res=0
nd = n // 10
for i in range(0, 10):
    res += 1 if s[i*nd:(i+1)*nd] == "T" * nd else 0 

print(res)