using System;
class Program
{
    static void Main()
    {
        Console.Write("");
        string ulaz = Console.ReadLine();
        string[] nm = ulaz.Split(' ');
        long n = Convert.ToInt64(nm[0]);
        long m = Convert.ToInt64(nm[1]);
        long[] szamok = new long[n];
        for (long i = 0; i < n; i++)
        {
            Console.Write("");
            szamok[i] = Convert.ToInt64(Console.ReadLine());
        }

        long sum = 0;
        for (long i = 0; i < n; i++)
        {
            if (szamok[i] == m)
                sum += 0;
            else
                sum+=(m-szamok[i]);
        }

        sum = sum - 2;

        Console.Write(sum.ToString());

        Console.ReadKey();
    }
}