An API gateway limits traffic using FIXED time windows of length w seconds: window 0 covers [0, w), window 1 covers [w, 2w), and so on. At most m requests may be admitted within any single fixed window; every request beyond the first m admitted requests within a window is rejected (dropped), and a rejected request does not count toward any window's quota.
You are given n requests' arrival timestamps (non-negative integers, seconds since start, given in non-decreasing order). For each request, its window index is floor(timestamp / w). Process requests in the given order: a request is admitted if the number of already-admitted requests in its window is strictly less than m; otherwise it is rejected.
Print the total number of admitted requests.
Input format
Line 1: three integers n, w, m.
Line 2: n space-separated non-decreasing integers, the request timestamps.
Output format
A single integer: the total number of admitted requests.
Constraints
- 1 <= n <= 100000
- 1 <= w <= 1000000
- 1 <= m <= 100000
- 0 <= timestamp <= 10000000, non-decreasing