1
print((lambda n, t: (lambda g, t: sum(all(c == 'T' for c in t[i * g: i * g + g]) for i in range(10)))(n // 10, t))(int(input()), input()))