l, k = map(int, input().split()) ll = l / 2 ans = 0 while ll > k: ll -= k ans += k print(ans)