const main=input=>{l=input.trim().split("\n");h=l[1].split(" ").map(e=>parseInt(e));l.slice(2).map(e => e.split(" ").map(a => parseInt(a)-1)).map(e=>{a=h[e[0]],b=h[e[1]];a!=!1&&b!=!1&&(a<b?(h[e[0]]=!1):(h[e[1]]=!1))});return h.filter(e=>e!=!1).length};console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')))