Time Limit: 2 sec / Memory Limit: 256 MB
Problem
Wolf Sothe loves implementing online judge problems, he wants to solve as many problems as possible. However, if he keeps solving problems every day without a rest, day by day the number of problems that can be solved in a day will reduce.
So, sometimes Wolf Sothe takes a day off. On that day, Wolf Sothe will not solve any problem, then for the next day and later Wolf Sothe will be able to solve problems.
The number of problems that Wolf Sothe can solve in a day is as follows:
- If that day is a working day, we define the number of days that Wolf Sothe has kept solving problems as (not including that day). Then Wolf Sothe can solve problems during that day.
- If that day is a rest day, during that day no problem will be solved.
Wolf Sothe wants to solve problems for days. Let the days be as a sequence from the 1st day to the day. Suppose that Wolf Sothe doesn't solve problems before the 1st day.
In addition, we known in advance that there are some decided rest days.
A list of all the decided rest days will be given. For any other day, you can mark it as a rest day or a working day. Please find the maximum value of the number of problems that can be solved during days.
Input
Inputs will be given by standard input in following format
:
- For the first line, integer , , , will be given divided by spaces. represents the number of the decided rest days.
- From the second line there are additional lines to give the information about decided rest days. For the line, an integer that represents the th decided rest day will be given. Please note that if , then
Output
Please output the maximum value of the number of problems that can be solved during days in one line.
Print a newline at the end of output.
Input Example 1Copy
5 6 2 0
Output Example 1Copy
20
Suppose that Wolf Sothe rest on the 3rd day and solve problems on the remaining days.
- For the 1st day, Wolf Sothe has kept solving problems for day. Thus, problems.
- For the 2nd day, Wolf Sothe has kept solving problems for day. Thus, problems.
- For the 3rd day, Wolf Sothe rests. Thus, problem.
- For the 4th day, Wolf Sothe has kept solving problems for day. Thus, problems.
- For the 5th day, Wolf Sothe has kept solving problems for day. Thus, problems.
In conclusion, will be solved in total.
Input Example 2Copy
6 4 3 1 3
Output Example 2Copy
13
Input Example 3Copy
12 10 3 3 2 7 10
Output Example 3Copy
71