program main implicit none integer(8) l,k,a read(*,*)l,k l=l-mod(l,2*k) write(*,*)l/2 end program main