#include <stdio.h>

#define mod 1000000007

int main(void)
{
	int n,m;
	
	scanf("%d%d",&n,&m);
	
	int a[m],i;
	
	for(i = 0; i < m; i++){
		scanf("%d",&a[i]);
	}
	
	int ans = 0;genzai = 0;
	
	while(genzai <= n){
		
		for(i = 0; i < n;i++){
			int count1 = 0,count2 = 0;
			if(genzai + 1 == a[i]){
				count1++;
			}
			if(genzai + 2 == a[i]){
				count2++;
			}
			if(count1 = 0){
				ans++;
				genzai++;
			}
			if(count2 = 0){
				ans++;
			}
		}
	}
	
	return 0;
	
}
		
		
		
	
	
	
	