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