l, k = map(int, input().split()); ans=0 while (ans+k < l/2): ans += k print(ans)