1
print(sum((lambda k, s: map(lambda l: all(map(lambda v: v == 'T', l)), [s[x:x+k] for x in range(0,len(s),k)]))(int(input()) // 10, input())))