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