l,k = map(int,input().split()) if 2*k < l: print(int(l/(2*k)) * k) else: print(0)