#include "iostream"
#include "iomanip"
using namespace std;

double c, d;
double num;
double ans;

int main() {
	cin >> c >> d;
	if (c >= d * 3) {
		cout << setprecision(20) << d * 4 * 1000<<"\n";
		return 0;
	}
	num = (d * 3 - c) * 7 / 13;
	ans = num * 2000;
	ans += (d - num * 5 / 7) * 4 * 1000;
	cout << setprecision(20) << ans << "\n";
	return 0;
}