import java.io.*; import java.util.*; public class Main_yukicoder453_1 { private static Scanner sc; private static Printer pr; private static void solve() { int c = sc.nextInt(); int d = sc.nextInt(); double max = 0; double lx = 0; double rx = c; for (int i = 0; i < 100; i++) { double c1x = (lx + lx + rx) / 3; double c2x = (lx + rx + rx) / 3; if (fx(c1x, c, d) < fx(c2x, c, d)) { lx = c1x; } else { rx = c2x; } max = Math.max(max, fx(rx, c, d)); } // pr.printf("%.7f\n", ret); pr.println(max); } private static double fx(double c1x, int c, int d) { double l = 0; double r = d; for (int j = 0; j < 100; j++) { double c1 = (l + l + r) / 3; double c2 = (l + r + r) / 3; if (f(c1, c1x, c, d) < f(c2, c1x, c, d)) { l = c1; } else { r = c2; } } return f(r, c1x, c, d); } private static double f(double y, double x, int c, int d) { double ret = Math.min(x * 4 / 3, y * 4) * 1000 + Math.min((c - x) * 7 / 2, (d - y) * 7 / 5) * 2000; return ret; } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }