c, d = [ int(v) for v in input().split() ] a = (20 * c - 8 * d) / 13 b = (-7 * c + 21 * d) / 13 amax = min(4 / 3 * c, 4 * d) bmax = min(7 / 2 * c, 7 / 5 * d) if a >= 0 and b >= 0: print(max(1000 * a + 2000 * b, 1000 * amax, 2000 * bmax)) else: print(max(1000 * amax, 2000 * bmax))