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