package src; import java.util.*; class C{ static Scanner s = new Scanner(System.in); public static void main(String[] args) { int c=s.nextInt(),d=s.nextInt(); if(c*5<=2*d) System.out.printf("%.10f",c*3500.0); else if(3*d<=c) System.out.printf("%.10f",d*4000.0); else System.out.printf("%.10f",(c*6000+d*34000)/13.0); } }