l,k = list(map(int,input().split(' '))) print((l//(k*2))*k)