import java.io.*; import java.util.*; class Main{ public static void main(String[] args) throws IOException{ Scanner scan=new Scanner(System.in); int l=Integer.parseInt(scan.next()); int k=Integer.parseInt(scan.next()); int count=0; while(l>2*k){ l-=2*k; count++; } int yuu=k*count; System.out.println(yuu); } }