L, K = map(int, raw_input().strip().split(" ")) print((L - 1) / (K + K) * K)