using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var s = NList; var (c, d) = (s[0], s[1]); var amin = 0.0; var amax = Math.Min(4 / 3.0 * c, 4 * d); var amid = Math.Max(0, Math.Min(amax, 20 / 13.0 * (c - 2 / 5.0 * d))); WriteLine(Math.Max(CalcSum(amin), Math.Max(CalcSum(amid), CalcSum(amax)))); double CalcSum(double counta) { return counta * 1000 + CountB(counta) * 2000; } double CountB(double counta) { return Math.Min((c - counta * 3 / 4) * 7 / 2, (d - counta / 4) * 7 / 5); } } }