#include<stdio.h>

#define MAX_N 200001
#define max(a,b) ((a) > (b) ? (a):(b))
#define min(a,b) ((a) < (b) ? (a):(b))

int main(void){

  int N,M,H[MAX_N],A[MAX_N],B[MAX_N],i,j,mem[MAX_N] = {0},ans = 0,big,small;

  scanf("%d %d",&N,&M);
  for(i = 0;i < N;i++){
    scanf("%d",&H[i]);
  }
  for(i = 0;i < M;i++){
    scanf("%d %d",&A[i],&B[i]);
  }

  for(i = 0;i < M;i++){
    big = max(A[i],B[i]);
    small = min(A[i],B[i]);
    if(mem[big-1] >= 0) mem[big-1]++;
    mem[small-1] = -1;
  }

  for(i = 0;i < N;i++){
    if(mem[i] >= 0) ans++;
  }

  printf("%d\n",ans);
  return 0;
}
