using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Prijatelji
{
    class Program
    {
        static void Main(string[] args)
        {
            //BEOLVASAS
            string[] sor = Console.ReadLine().Split();
            int N = int.Parse(sor[0]);
            int M = int.Parse(sor[1]);
            int[] A = new int[N];
            int[] BaratokSzama = new int[N];
            int[,] Parok = new int[M, 2];

            int boldogsag = 0;

            for (int i = 0; i < N; i++)
            {
                A[i] = int.Parse(Console.ReadLine());
                BaratokSzama[i] = 0;
            }

            for (int i = 0; i < M; i++)
            {
                sor = Console.ReadLine().Split();
                Parok[i, 0] = int.Parse(sor[0]);
                Parok[i, 1] = int.Parse(sor[1]);
            }
            for (int i = 0; i < M; i++)
            {
                int x = Parok[i, 0];
                BaratokSzama[x - 1]++;
                x = Parok[i, 1];
                BaratokSzama[x - 1]++;
            }
            foreach (int x in BaratokSzama)
            {
                boldogsag += x;
            }

            Console.WriteLine(boldogsag);
            //Console.ReadLine();
        }
    }
}