#include using namespace std; double x, y; double calc(double a) { return (a * 4 / 3 * 1000 + min((x - a) * 7 / 2, (y - a / 3) * 7 / 5) * 2000); } int main() { cin >> x >> y; double low = 0, high = min(x, y * 3); for(int i = 0; i < 500; i++) { double l = (low * 2 + high) / 3; double r = (low + high * 2) / 3; if(calc(l) < calc(r)) low = l; else high = r; } cout << fixed << setprecision(10) << calc(low) << endl; }