{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE StrictData #-}
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import Data.Array.Unboxed
import Data.Array.ST
import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Data.List
import Data.Char

main :: IO ()
main = do
    [n,m] <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
    vec <- V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
    vec2 <- V.replicateM m $ (\vec -> (vec V.! 0, vec V.! 1)) . V.unfoldrN 2 (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
    let v :: V.Vector [Int]
        v = V.create $ do
            v <- VM.replicate n []
            forM_ [0..m-1] $ \i -> do
                let (x,y) = vec2 V.! i
                VM.modify v ((:) (x-1)) (y-1)
                VM.modify v ((:) (y-1)) (x-1)
            return v
    print $ length [ i | i <- [0..n-1], (vec V.! i) > (maxi $ map ((V.!) vec) (v V.! i)) ]

maxi :: [Int] -> Int
maxi [] = 0
maxi xs = maximum xs