C, D = map(int, input().split()) # Calculate possible intersection point of the two constraints numerator_x = 20 * C - 8 * D x = numerator_x / 13 numerator_y = 7 * (3 * D - C) y = numerator_y / 13 candidates = [] # Check if the intersection is valid (non-negative) if x >= 0 and y >= 0: # Add the sales from the intersection point candidates.append(1000 * x + 2000 * y) # Calculate maximum sales if only producing product A x_a = min(4 * C / 3, 4 * D) candidates.append(1000 * x_a) # Calculate maximum sales if only producing product B y_b = min(7 * C / 2, 7 * D / 5) candidates.append(2000 * y_b) # Determine the maximum sales from all valid candidates max_sales = max(candidates) # Format the output to remove trailing zeros and unnecessary decimal points formatted = "{0:.12f}".format(max_sales).rstrip('0').rstrip('.') print(formatted)