c, d = map(int, input().split()) can_tuple = list() if 4*d < 4*c/3: can_tuple.append( (4*d, 0) ) else: can_tuple.append( (c*4/3, 0) ) if d*7/5 < c*7/2: can_tuple.append( (0, d*7/5) ) else: can_tuple.append( (0, c*7/2) ) if (5*c-2*d)*4/13 > 0 and (3*d-c)*7/13 > 0: can_tuple.append( ((5*c-2*d)*4/13, (3*d-c)*7/13) ) res_max = 0 for x, y in can_tuple: res_max = max(res_max, 1000*x+2000*y) print(res_max)