#include <bits/stdc++.h>

using namespace std;

int N,M,A[1005],x,y;

int main () {

    cin >> N >> M;

    for (int i=1; i<=N; i++) {
        cin >> A[i];
    }


    for (int i=1; i<=M; i++) {
        cin >> x[i] >> y[i];
    }

    cout << 2*M << endl;


return 0;
}