import java.util.*; public class ok{ public static void main(String[] args) { Scanner sc=new Scanner (System.in); int L=sc.nextInt(); int K=sc.nextInt(); int ans=0; ans=L/(K*2); ans*=K; System.out.println(ans); }}