1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
n = int(input())
s = input()
ok = 0
for i in range(10):
    count = 0
    for j in range(n // 10):
        if s[i * (n // 10) + j] == 'T':
            count += 1
    if count == n // 10:
        ok += 1
print(ok)