object Main extends App {
  import scala.io.StdIn._
  solve
  def solve: Unit = {
    val Array(n, m, t) = readLine.trim.split(' ').map(_.toInt)
    val time: Array[Int] = readLine.trim.split(' ').map(_.toInt)
    var sumDiff = time(0) - m + (if (t - time(n - 1) > m) t - time(n - 1) - m else 0)
    for (i ← 1 until n){
      if (time(i) - time(i - 1) >= 2 * m) sumDiff += time(i) - time(i - 1) - 2 * m
    }
    println(sumDiff)
  }
  implicit class ScopeFunc[T](private val value: T) {
    def let[A](func:T ⇒ A): A = func(value)
    def also(func:T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}


