POKLON
문제
Grandma has two grandchildren who she likes to give gifts to. Today she bought them N gifts of various prices, which the children have to divide among themselves. The children alternate in taking one gift each, starting with the older child. Greedy as kids are, they always take the most expensive remaining gift.
Grandma knows that the older child will not be happy unless the total value of his gifts is at least A more than the other kid's. The younger child will not be happy if the value of the older kid's gifts is more than B more his own. In other words, the difference of the total values of gifts must be between A and B, inclusive, to make both kids happy.
The values of gifts are positive integers. The value of each gift is clearly printed on the gift, expect on one gift. After shopping, but before bringing the gifts home, grandma decided to stick a phony price tag onto that one gift so that both kids are happy after they have split the gifts. Of course, the phony price must also be an integer (or the kids will find it suspicious).
Write a program that determines how many different prices she can put on the unlabeled gift.
입력
The first line contains three integers A, B and N (1 ≤ A ≤ B ≤ 109, 1 ≤ N ≤ 100 000) separated by spaces. The numbers A and B represent the kids' conditions, while the number N is the number of gifts.
Each of the following N−1 lines contains the price of one gift. All prices are integers less than 109. The prices will be sorted in descending order. The unlabeled gift does not appear in the input, of course.
출력
Output a single integer – the number of different price tags grandma can choose.
예제
예제 1
3 3 4 5 5 5
2
예제 2
50 60 3 100 20
22
예제 3
6 15 7 17 13 10 10 6 2
23