Alpine skiing
The harsh winter in Saint-Barnaurg spans n days. Tanya, an avid skier, frequently visits the nearby ski resort in Tbiatykent. She recalls that on certain days last winter, she was at the resort because she posted photos from the slopes on the social network SkiForces. However, there is no information about her whereabouts on other days.
Tanya always follows the same routine for her trips: she departs in the morning, spends exactly k days at the resort, and returns in the evening of the k-th day. It's possible that she embarked on a new trip immediately after returning from a previous one. On days she wasn't at the resort, Tanya stayed in the city.
Now that winter has ended, her friends claim she skis excessively. To evaluate this, Tanya wants to determine the maximum number of winter days she could have spent in the city.
Tanya's first trip could have started before winter began, and her last trip might have concluded after winter ended.
Input
The first line contains three positive integers n, k, and m: the duration of winter in days, the length of one ski trip in days, and the number of days Tanya was definitely at the resort (1 ≤ k ≤ n ≤ 10^9
, 1 ≤ m ≤ 2 * 10^5
, m ≤ n).
The second line lists m integers d[1]
, d[2]
, ..., d[m]
, representing the days Tanya was definitely at the resort (1 ≤ d[i]
≤ n). Each day appears only once.
Output
Output a single integer: the maximum number of winter days Tanya could have spent in the city.
Examples
Note
In the first example, Tanya could have visited the resort twice: first, starting the day before winter and ending on the 1st day of winter; second, starting on the last day of winter and ending on the 1st day after winter.
Thus, Tanya could have spent the 2nd and 3rd days of winter in the city.
In the second example, Tanya might have visited the resort once, starting on the 2nd day of winter and ending on the 5th day. Therefore, Tanya could have spent three days in the city: the 1st, 6th, and 7th days of winter.