let input = readLine()!.split(separator: " ").map{Int($0)} let L = input[0]! let K = input[1]! * 2 print(K * (L / K) - ((L % K) == 0 ? 1 : 0) / 2)