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

namespace prijatelji
{
    class Program
    {
        static void Main(string[] args)
        {
            string []  s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int m = int.Parse(s[1]);
            int y = 0;
            for (int i = 1; i <= n; i++)
            {
                int x = int.Parse(Console.ReadLine());
                y = x * (m - 1);
            }
            Console.WriteLine(y);
        }
    }
}