L, K = map(int, raw_input().split()) if L <= K*2: print 0 else: print L/K/2*K