L, K = gets.split.map(&:to_i) bite = 2 * K if L <= bite puts 0 elsif L % bite == 0 puts (L / bite - 1) * K else puts L / bite * K end