#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;


int main(){

	int N,M,tmp;
	scanf("%d %d",&N,&M);

	for(int i = 0; i < M; i++)scanf("%d",&tmp);

	printf("%d\n",(N-M)-1);

	return 0;
}