#include <stdio.h>
int main(void) {
  int days, num;
  int homework, i, sum_day=0;
  scanf("%d %d", &days, &num);
  for(i=0;i<num; i++){
    scanf("%d", &homework);
  sum_day+=homework;
  }
  printf("%d\n", days - sum_day);
  return 0;
}