#include <stdio.h>

long long int Hi[100000], count[100000], ab[100000];

int main()
{
    long long int n, m, r1, r2, i, cnt;
    scanf("%lld %lld", &n, &m);
    for (i=0; i<n; i++) scanf("%lld", &Hi[i]);
    for (i=0; i<m; i++) {
        scanf("%lld %lld", &r1, &r2);
        ab[r1-1]=1; ab[r2-1]=1;
        if (Hi[r1-1]>Hi[r2-1]) {
            count[r1-1]=1;
            count[r2-1]=0;
        }

        if (Hi[r2-1]>Hi[r1-1]) {
            count[r2-1]=1;
            count[r1-1]=0;
        }
    }
    cnt=0;
    for (i=0; i<n; i++)
        if (count[i]==1) cnt++;
    for (i=0; i<n; i++)
        if (ab[i]==0) cnt++;
    printf("%lld\n", cnt);
    return 0;
}
