1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def main():
    n = int(input())
    line = input().strip()
    part_size = n // 10
    total = 0
    for idx in range(10):
        if all(test=='T' for test in line[part_size * idx: part_size * (idx + 1)]):
            total += 1
    print(total)

if __name__ == "__main__":
    main()