if __name__ == "__main__": n: str = input() text: str = input() tests = int(int(n) / 10) result = 0 passed = 0 for i, char in enumerate(text): if char == "T": passed += 1 if ((i + 1) % tests) == 0: result += int(passed / tests) passed = 0 print(result)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | if __name__ == "__main__": n: str = input() text: str = input() tests = int(int(n) / 10) result = 0 passed = 0 for i, char in enumerate(text): if char == "T": passed += 1 if ((i + 1) % tests) == 0: result += int(passed / tests) passed = 0 print(result) |