영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)
Problem
Bosse likes chocolate. He therefore always has an opened chocolate box in the pantry. When it runs out, he secretly buys a new one and pretends nothing happened. Bosse's wife, who is suspicious by nature, is puzzled that the box never seems to run out. She therefore begins to occasionally count the number of chocolate pieces remaining. Write a program that, given her observations, computes the minimum number of new boxes Bosse must have bought during the period.
Input
The first line contains an integer N (1 ≤ N ≤ 100), the number of observations.
The second line contains N integers, the number of chocolate pieces in the box (between 1 and 100) at each observation, in the order they are made.
Output
Print an integer: the minimum number of new boxes Bosse must have provably bought during the period.
예제
예제 1
10 17 15 16 16 18 17 14 12 13 9
3