1
print([(data := [int(input()) // 10, input()]), sum(map(lambda x: x == 'T' * data[0], [data[1][i:i+data[0]] for i in range(0, len(data[1]), data[0])]))][1])