using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		string[] input = Console.ReadLine().Split(' ');
		int n = int.Parse(input[0]);
		long d = long.Parse(input[1]);
    long[] nums = Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);
    long[][] distances = new long[n-1][];
    long answer = 0;
    int usedMemo = 0;
    for(int i = 0; i < n-1; i++)
    {
      distances[i] = new long[2];
      distances[i][0] = i;
      distances[i][1] = nums[i+1] + d*i;
    }
    Array.Sort(distances, (a, b) => a[1].CompareTo(b[1]));

    for(int i = 0; i < n-1; i++)
    {
      answer += nums[i];
      
      while(true)
      {
        if(distances[usedMemo][0] >= i)//使用可能な行き先
        {
          answer += d*(distances[usedMemo][0]-i+1);
          answer += nums[distances[usedMemo][0]+1];
          break;
        }else
        {
          usedMemo++;
        }
      }
    }
		
		Console.WriteLine(answer);
	}
}