1
2
3
4
5
n=int(input())//10
s=input()
a=0
for i in s:a+='T'*n==s[-n:];s=s[:-n]
print(a)