1
2
3
n = int(input())
s = input()
print(sum((all(map(lambda x: x=='T', s[i:i+len(s)//10])) for i in range(0,len(s), len(s)//10))))