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