import sys def solve(input): score = 0 k = len(input) // 10 for i in range(0, len(input), k): gr = input[i:i+k] if 'N' not in gr: score += 1 return score sys.stdin.readline() input = sys.stdin.readline().strip() print(solve(input))
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | import sys def solve(input): score = 0 k = len(input) // 10 for i in range(0, len(input), k): gr = input[i:i+k] if 'N' not in gr: score += 1 return score sys.stdin.readline() input = sys.stdin.readline().strip() print(solve(input)) |