n = int(input())/10 s = input() result = 0 b = True i = 1 for c in s: if (c == 'N'): b = False if (i % n == 0): if b: result += 1 b = True i += 1 print(result)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | n = int(input())/10 s = input() result = 0 b = True i = 1 for c in s: if (c == 'N'): b = False if (i % n == 0): if b: result += 1 b = True i += 1 print(result) |