il = int(input()) inp = input() inp = [*inp] il = il/10 i = 0 score = 0 while i != 10: j = 0 answer = 0 while j != il: if inp[int(i * il + j)] == "T": answer += 1 j += 1 if answer == il: score += 1 i += 1 print(score)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | il = int(input()) inp = input() inp = [*inp] il = il/10 i = 0 score = 0 while i != 10: j = 0 answer = 0 while j != il: if inp[int(i * il + j)] == "T": answer += 1 j += 1 if answer == il: score += 1 i += 1 print(score) |