#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,m;
    scanf("%d %d", &n, &m);
    int a[n];
    int b[m][2];
    for (int i=0;i<n;i++) scanf ("%d", &a[i]);
    for (int j=0;j<m;j++){
         for (int k=0;k<2;k++) scanf ("%d", &b[j][k]);
    }
    printf("%d", 2*m);
}