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) print(max(1000 * a + 2000 * b, 1000 * a, 2000 * b))