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