#include<stdio.h>
int main(){
	int Tai_num, Road_num;
	scanf("%d", &Tai_num);
	scanf("%d", &Road_num);
	int height[5000];
	int road[5000][2];
	int delete[500];
	int i = { 0 };


	//高度和道路数组
	for (int i = 0;i < Tai_num;i++)
		scanf("%d", &height[i]);

	for (int i = 0;i < Road_num;i++)
		for (int j = 0;j < 2;j++)
			scanf("%d", &road[i][j]);

	for (int i = 0;i < Road_num;i++)
	{
		int first = road[i][0];
		int second = road[i][1];

		if (height[first] > height[second])
			delete[i++] = second;
		else
			delete[i++] = first;        //获得对应不满足要求的下标
	}
	
	for (int i = 0;i < Tai_num;i++)
	{
		for (int j = 0;j < 50;j++)
			if (i == delete[j]) {
				Tai_num--;
				break;
			}
	}
	printf("%d", Tai_num);

}