#include <stdio.h>
#include <stdlib.h>
int main(void) {
  int n;
  int m;
  int *a;
  int sum = 0;
  scanf("%d, %d", &n, &m);
  a = (int *)malloc(m * sizeof(int));
  scanf("%d", &a);
  for(int i = 0; i < m; i++) {
    sum += a[i];
  }
  printf("%d", n - sum);
  return 0;
}
