An airport has G gates, numbered 1 through G.
P planes arrive in a fixed order. Plane i docks permanently at one gate that is still empty among gates 1 through gi. A gate holds at most one plane, and a plane that has docked never moves to another gate. If no gate is left for the plane that is arriving, the airport closes and no further plane arrives.
Dock as many planes as possible. How many planes dock at most?
The first line contains the number of gates G (1≤G≤105).
The second line contains the number of planes P (1≤P≤105).
Each of the next P lines contains one integer gi (1≤gi≤G), the highest gate number that plane i can use, given in arrival order.
Print the maximum number of planes that can dock, on one line.