The stone game is a game where two people take stones in alternating turns.
There are N stones on a table. Sanggeun and Changyoung take stones one after the other, and the numbers of stones a player may take in one turn are fixed in advance. A player who cannot take one of the allowed numbers of stones on their turn loses the game. Sanggeun goes first, and both players play as well as they possibly can.
Given M and the numbers of stones a player may take in one turn, write a program that counts how many values of N between 1 and M let Changyoung win.
The first line contains M. (1≤M≤109)
The second line contains the number of allowed moves K. (1≤K≤22)
The third line contains the K numbers of stones a player may take in one turn, separated by spaces. Each number is at least 1 and at most 22, no number repeats, and they are given in increasing order.
Print how many values of N let Changyoung win. (1≤N≤M)