a,b = map(int, input().split()) m = b * 2 if a % m == 0: print(int(a/2-b)) else: print((a//m)*b)