1
2
3
4
n = int(input())
g = n // 10
t = input().strip()
print(sum(t[i * g:(i+1)*g].count('T')//g for i in range(10)))