a,b = map(int, input().split()) cnt = 0 while a > b * 2: a -= b * 2 cnt += 1 print(b * cnt)