import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); long L,K; L = scan.nextInt(); K = scan.nextInt(); long haruka_length = K; long yu_length = K; long yu_total = 0; while(L >= 0){ if(L - haruka_length - yu_length <= 0){ L -= haruka_length; }else{ yu_total += yu_length; L = L - haruka_length - yu_length; } } System.out.println(yu_total); scan.close(); } }