n,m = list(map(int,input().split()))

if n == 1 and m == 1:

  print((10**6))

else:

  print(((max(0,(4-n))+max(0,(4-m)))*(10**5)))
#!/usr/bin/env python3

x,y = list(map(int,input().split()))

if x == 1 and y == 1:

#if False:

    print((10**6))

else:

    print(((max(0,4-x)+max(0,4-y))*(10**5)))
n, m = list(map(int, input().split()))
if n == 1 and m == 1:
    print((10**6))
else:
    print(((max(0, (4 - n)) + max(0, (4 - m))) * (10**5)))

#!/usr/bin/env python3
x, y = list(map(int, input().split()))
if x == 1 and y == 1:
    # if False:
    print((10**6))
else:
    print(((max(0, 4 - x) + max(0, 4 - y)) * (10**5)))

-n, m = list(map(int, input().split())) -if n == 1 and m == 1: +#!/usr/bin/env python3 +x, y = list(map(int, input().split())) +if x == 1 and y == 1: +    # if False: -    print(((max(0, (4 - n)) + max(0, (4 - m))) * (10**5))) +    print(((max(0, 4 - x) + max(0, 4 - y)) * (10**5)))