1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
N = int(input().strip())
S = input().strip()

k = N//10


def all_T(w):
    return all(x == 'T' for x in w)


print(sum(all_T(S[k*i:k*i+k]) for i in range(10)))