c, d =map(int, input().split()) if 3*d <= c: x = 4*d y = 0 elif c < 3*d and 2*d <= 5*c: x = (20*c-8*d)/13 y = (-7*c+21*d)/13 else: x = 0 y = 7*c/2 print(1000*x+2000*y)