output_description: Assume that the shower will emit water for a total of X seconds. Print X.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N T
      t_1 t_2 ... t_N
attempt: from __future__ import print_function
  
  import sys
  
  input = sys.stdin.readline
  
  
  def eprint(*args, **kwargs):
      print(*args, file=sys.stderr, **kwargs)
      return
  
  
  # import re
  # import array
  # import copy
  # import functools
  # import operator
  
  # import math
  # import string
  import fractions
  
  # from fractions import Fraction
  from fractions import gcd
  
  # import collections
  # import itertools
  # import bisect
  
  # import heapq
  # from heapq import heappush
  # from heapq import heappop
  # from heapq import heappushpop
  # from heapq import heapify
  # from heapq import heapreplace
  # from queue import PriorityQueue as pq
  from queue import Queue
  
  # from itertools import accumulate
  
  # from collections import deque
  # from collections import Counter
  
  from operator import mul
  from functools import reduce
  
  # def lcm(n,m):
  #     return int(n*m/gcd(n,m))
  
  
  def coprimize(p, q):
      common = fractions.gcd(p, q)
      return (p // common, q // common)
  
  
  def combinations_count(n, r):
      r = min(r, n - r)
      numer = reduce(mul, range(n, n - r, -1), 1)
      denom = reduce(mul, range(1, r + 1), 1)
      return numer // denom
  
  
  # import random
  # import time
  # import entrypoints
  n, t = map(int, input().strip().split())
  a = list(map(int, input().strip().split()))
  # aa = [a[0]] + [(a[i+1] + a[i]) for i in range(0, n - 1)]
  # eprint("aa ", end=": ")
  # eprint(aa)
  # aa = []
  # aa.append(a[0])
  # for i in range(1, n):
  #     aa.append(a[i] + aa[i - 1])
  a.append(sys.maxsize)
  eprint("aa ", end=": ")
  eprint(a)
  
  ans = 0
  first_flag = 1
  continuous_flag = 0
  l_continuous = []
  l_distinct = []
  for i in range(n):
      if a[i] + t >= a[i + 1]:
          if not (i in l_continuous):
              l_continuous.append(i)
          if a[i + 1] != sys.maxsize and not ((i + 1) in l_continuous):
              l_continuous.append(i + 1)
      else:
          if not (i in l_continuous):
              l_distinct.append(i)
  eprint("l_continuous ", end=": ")
  eprint(l_continuous)
  eprint("l_distinct ", end=": ")
  eprint(l_distinct)
  i_start = 0
  i_end = 0
  for i in l_continuous:
      first_flag = 1
      if (i in l_continuous) and ((i + 1) in l_continuous):
          if first_flag == 1:
              i_start = 0
      else:
          i_end = i
          ans += a[i_end] - a[i_start] + t
  
  for i in l_distinct:
      ans += t
  
  print(ans)
  
problem_description: Statement
  
  In a public bath, there is a shower which emits water for T seconds when the
  switch is pushed.
  
  If the switch is pushed when the shower is already emitting water, from that
  moment it will be emitting water for T seconds. Note that it does not mean
  that the shower emits water for T additional seconds.
  
  N people will push the switch while passing by the shower. The i-th person
  will push the switch t_i seconds after the first person pushes it.
  
  How long will the shower emit water in total?
samples: [{"input": "2 4\n    0 3", "output": "7\n    \n\nThree seconds after the first person pushes the water, the switch is pushed\nagain and the shower emits water for four more seconds, for a total of seven\nseconds.\n\n* * *"}, {"input": "2 4\n    0 5", "output": "8\n    \n\nOne second after the shower stops emission of water triggered by the first\nperson, the switch is pushed again.\n\n* * *"}, {"input": "4 1000000000\n    0 1000 1000000 1000000000", "output": "2000000000\n    \n\n* * *"}, {"input": "1 1\n    0", "output": "1\n    \n\n* * *"}, {"input": "9 10\n    0 3 5 7 100 110 200 300 311", "output": "67"}]