1
2
3
4
n = int(input()) // 10
tests = input()

print(sum(all(test == 'T' for test in group) for group in zip(*[iter(tests)]*n)))