program abc060c
  use,intrinsic :: iso_fortran_env
  implicit none
  integer(int64) :: n, t
  integer(int64),dimension(:),allocatable :: a
  read *, n, t
  allocate(a(n))
  read *, a
  a = [a, 0_8] - [0_8, a]
  a = a(2:)
  a(n) = t
  print *, sum(merge(a, t, a < t))
end program abc060c
