cho.sh
Notes
Loading...

Tickets

Time limit

2s

Memory limit

128 MB

Problem

There is a train with N seats, numbered from 1 to N. A railway company wants to sell tickets to families traveling for the holidays. For this problem, assume that every family has exactly L members.

Each family has one preferred block of seats. If a family's preferred starting seat is z, that family wants the L consecutive seats from z through z+L-1.

If a family receives exactly its preferred block, the potential profit is 2. If the family buys L tickets but not for its preferred block, the potential profit is 1. If no tickets are sold to that family, the potential profit is 0. The same seat cannot be sold to two families at the same time.

Given every family's preferred starting seat, compute the maximum total potential profit.

Input

The first line contains three integers N, L, and M (1 ≤ N ≤ 30,000, 1 ≤ L ≤ 100, 1 ≤ M ≤ 100,000).

The second line contains M integers z_i (1 ≤ z_i ≤ N-L+1). The i-th integer z_i means that the i-th family wants seats z_i through z_i+L-1.

Output

Print the maximum total potential profit.

Hint

In the visible sample, families 1, 3, and 5 receive their preferred seats. Family 4 receives seats 13, family 2 receives seats 79, and family 6 receives seats 13~15, for a total potential profit of 9.