import java.util.Scanner object pokky { def main(args: Array[String]): Unit = { val sc = new Scanner(System.in) var l = sc.nextInt val k = sc.nextInt var y = 0 var count = 0 while(l > 0) { l = l - 2 * k if (l <= 0) { y = k * count } count += 1 } println(y) } }