import java.util.*; public class Pokky{ public static void main(String[] arg){ Scanner sc = new Scanner(System.in); int l,k,temp,res; l = sc.nextInt(); k = sc.nextInt(); temp = (l-1)/(2*k); res = temp * k; System.out.println(res); } }