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

namespace ConsoleApplication15
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s;
            s = Console.ReadLine().Split();
            int N = int.Parse(s[0]);
            int M = int.Parse(s[1]);
            int[] A = new int[N];
            int[] X = new int[M];
            int[] Y = new int[M];
            int[] sreca = new int[N];
            for (int i = 0; i < N; i++)
            {
                A[i] = int.Parse(Console.ReadLine());
            }
            for (int i = 0; i < M; i++)
            {
                s = Console.ReadLine().Split();
                X[i] = int.Parse(s[0]);
                Y[i] = int.Parse(s[1]);
            }
            Console.WriteLine(2 * M);
        }
    }
}