#include<stdio.h>

int main(void){
    int M, Sum = 0;
    double N;
    scanf("%lf %d",&N, &M);
    int A[M];
    for(int i = 0; i < M; i++){
        scanf("%d",&A[i]);
        Sum += A[i];
    }
    printf("%d\n",N-Sum);
    return 0;
}