Sampriti is a self-confessed sweet lover. Please find proof enclosed below:
N
days..K
sweets. If more than K
sweets are present in a day, she uses multiple boxes.1
. Sampriti believes a sweet to be Yummylicious
if its index (for a day) is same as the box number it is stored in. Given the schedule for her sweets feast can you count the number of Yummylicious
sweets she’s gonna have?
Note: See the diagram in the Explanation section for more details.
Input Format
The first line contains two integers N
and K
— the number of days and the maximum number of sweets per box respectively.
The second line contains N integers T1, T2,…,Tn where Ti denotes the number of sweets Sampriti eats on the ith day.
Output Format
Print the number of Yummylicious
sweets Sampriti has.
Constraints
1≤ N, K, Ti ≤100
The diagram below depicts Sampriti’s sweet feast with N=5
days and a maximum of K=3
sweets per box. Yummylicious
sweets are outlined in red, and box numbers numbers are in squares.
Yummylicious
sweets and thus we print the number 3
on a new line.