PivotOJ

Tired Terry

시간 제한: 1000ms메모리 제한: 512MB출처: ICPC Rocky Mountain Regional 2019BOJ 17882

문제

Terry is feeling tired and he suspects it is because of a lack of sleep. He created a device that records his sleeping pattern over a period of time measured in seconds.

Assuming that the recorded sleeping pattern keeps repeating, help Terry by letting him know how often he is tired during each of the repeating time periods.

More precisely, for integers p and d, we say that Terry is tired at second i if from second i − p + 1 to second i (inclusive) he has slept for less than d seconds.

입력

The first line of input contains three integers n (1 ≤ n ≤ 86 400), the length of Terry’s sleep pattern, p (1 ≤ p ≤ N), and D (1 ≤ d ≤ p) as described above.

The second line of input contains a single string of length n which describes the period of time that is recorded. The ith such character is a W if Terry is awake at the ith second, or is a Z if Terry is asleep at the ith second.

출력

Display a single integer which represents the number of seconds that Terry is tired during each of the repeating time periods.

예제

예제 1

입력
2 1 1
WZ
출력
1

예제 2

입력
5 3 2
WZWWZ
출력
4
코드를 제출하려면 로그인하세요.