def check_if_correct(T, p, k): for i in range(p, k): if T[i] == 'N': return False return True def count_points(T, n): res = 0 r = n // 10 for i in range(0, len(T), r): if check_if_correct(T, i, i + r): res += 1 return res n = int(input()) T = input() print(count_points(T, n))
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | def check_if_correct(T, p, k): for i in range(p, k): if T[i] == 'N': return False return True def count_points(T, n): res = 0 r = n // 10 for i in range(0, len(T), r): if check_if_correct(T, i, i + r): res += 1 return res n = int(input()) T = input() print(count_points(T, n)) |