d = list(map(int,input().split())) c = int(d[0]/(d[1]*2)) if d[0]-(d[1]*(c*2)) != 0: print(c*d[1]) else: print(0)