program sample
    implicit none
  
    integer(8) :: i,j,m,n,x
    real(8)::a,b
    integer(8),allocatable ::h(:)
  
    read(*,*) n
    allocate(h(n))
    x=0
    m=0
    do i=1,100
        do j=1,100
         if (h(j)>0) then
           x=1
           h(j)=h(j)-1
         else if (h(j)==0 .and. x==1) then
           m=m+1
           x=0
         end if
        end do
    end do
    write(*,*) m
  
    stop
end program sample
  

