1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import sys

n = int(sys.stdin.readline().strip())
npt = n // 10
X = sys.stdin.readline()
result = 0

for i in range(10):
	if X[i * npt : (i + 1) * npt] == "T" * npt:
		result += 1

print(result)