#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N, M;
    scanf("%d %d", &N, &M);

    vector<int> A(N);
    for (int i = 0; i < N; ++i) scanf("%d", &A[i]);

    map<int, int> B;
    for (int i = 0; i < M; ++i) {
        int x, y; scanf("%d %d", &x, &y);
        B[x]++;
        B[y]++;
    }

    int sol = 0;
    for (auto it : B) {
        sol += it.second;
    }

    printf("%d", sol);

    return 0;
}