L, K = map(int, raw_input().split()) i = (L - 1) / (2 * K) print K * i