def main(): l,k = map(int,input().split()) length = l eat = 0 '''while(length > k*2): eat += k length -= k*2 print(eat)''' #TLEになる count = length // (k*2) print(count*k) if __name__ == '__main__': main()