let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (N, T) = (input[0], input[1])
let t = readLine()!.characters.split(" ").map{Int(String($0))!}
print((1..<N).reduce(T){$0+min(t[$1]-t[$1-1], T)})