1
 2
 3
 4
 5
 6
 7
 8
 9
10
tests = int(input())
test = input()
c = tests // 10
result = 0
for i in range(0, len(test) - c + 1, c):
    # print(test[i:i + c])
    if test[i:i + c].count("T") == c:
        result += 1

print(result)