#include using namespace std; // X = 4x/3 [y = (x/3)] // Y = min(7x/2, 7y/5) // 1000X+2000Y=Z(maximalize) double x,y; double calc(double a){ return (4*a/3*1000 + min(7*(x-a)/2, 7*(x-a/3)/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; } printf("%.10lf\n", calc(low)); return 0; }