l,k = map(int,input().split()) s = (l-1)//(2*k) print(s*k)