C, D = map(int, input().split()) if 5*C-2*D<=0: print(4000*C/3) elif 3*D-C<=0: print(4000*D) else: print((6000*C+34000*D)/13)