# coding: utf-8 # Your code here! C,D=map(int,input().split()) a0 = min(C * 4/3, D * 4/1) b0 = min(C * 7/2, D * 7/5) a=4/13*(5*C-2*D) b=7/13*(-C+3*D) if a<0 or b<0: a,b=0,0 print(max(1000*a+2000*b,1000*a0,2000*b0))