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