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