Mirko and Slavko play MO, a one-dimensional mini-go game. The board consists of P squares numbered from 1 to P from left to right.
Mirko uses white stones and plays first. Slavko uses black stones and plays second. At the beginning, every square is empty. The players alternate turns, and on each turn the current player places one stone of their color on the empty square given in the input.
If the newly placed stone and an existing stone of the same color enclose a contiguous run containing only the opponent's stones, all stones in that run are removed from the board. This check is performed separately to the left and to the right of the newly placed stone.
After all moves have been played, compute how many white stones and how many black stones remain on the board.
The first line contains two integers P and N, separated by a space: the number of squares on the board and the total number of moves. (1 ≤ P ≤ 100, 1 ≤ N ≤ 1000)
Each of the next N lines contains the square number for one move, in game order. The number denotes an empty square where the current player places a stone. The first move is white, the second move is black, and the colors continue alternating.
Output one line containing the number of white stones and the number of black stones remaining after the game ends, separated by one space.