Problem:
 Score: 100 points    Problem Statement  We held two competitions: Coding Contest and Robot Maneuver.  In each competition, the contestants taking the 3 -rd, 2 -nd, and 1 -st places receive 100000 , 200000 , and 300000 yen (the currency of Japan), respectively. Furthermore, a contestant taking the first place in both competitions receives an additional 400000 yen.  DISCO-Kun took the X -th place in Coding Contest and the Y -th place in Robot Maneuver.
Find the total amount of money he earned.      Constraints   1 \leq X \leq 205  1 \leq Y \leq 205  X and Y are integers.         Input  Input is given from Standard Input in the following format:  X  Y       Output  Print the amount of money DISCO-Kun earned, as an integer.        Sample Input 1 1 1      Sample Output 1 1000000  In this case, he earned 300000 yen in Coding Contest and another 300000 yen in Robot Maneuver. Furthermore, as he won both competitions, he got an additional 400000 yen.
In total, he made 300000 + 300000 + 400000 = 1000000 yen.       Sample Input 2 3 101      Sample Output 2 100000  In this case, he earned 100000 yen in Coding Contest.       Sample Input 3 4 4      Sample Output 3 0  In this case, unfortunately, he was the highest-ranked contestant without prize money in both competitions.

Solution (Python):
X, Y = map(int,input().split())

def get_money(X):
    if X == 1:
        return 300000
    elif X == 2:
        return 200000
    elif X == 3:
        return 100000
    else:
        return 0

def double_money(X, Y):
    if X == 1 and Y == 1:
        return 400000
    else:
        return 0

sum = get_money(X) + get_money(Y) +double_money(X, Y)

print(sum)

Solution (Python):
x,y = map(int,input().split())
x1=0
y1=0

if x==1:
  x1=300000
elif x==2:
  x1=200000
elif x==3:
  x1=100000

if y==1:
  y1=300000
elif y==2:
  y1=200000
elif y==3:
  y1=100000
  
if x==1 and y==1:
  print(x1+y1+400000)
else:
  print(x1+y1)

Solution (Python):
x,y = map(int,input().split())
key = [100000,200000,300000]
ans = 0
if x==1 and y== 1:
  print(300000*2+400000)
else:
  if x<4:
    ans += key[-x]
  if y<4:
    ans += key[-y]
  print(ans)

Solution (Python):
import sys
import math
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

x, y = na()
ans = 0
if x < 4:
    ans += (4-x) * 100000
if y < 4:
    ans += (4-y) * 100000
if x==1 and y==1:
    ans = 10*100000

print(ans)

Solution (Python):
def f(n):
  if n == 3:
    ret = 100000
  elif n == 2:
    ret = 200000
  elif n == 1:
    ret = 300000
  else:
    ret = 0
  return ret

X, Y = map(int, input().split())
ans = f(X) + f(Y)
if X == 1 and Y == 1:
  ans += 400000

print(ans)

Solution (Python):
from collections import defaultdict
X, Y = map(int, input().split())
dd = defaultdict(int)
dd[1] = 300000
dd[2] = 200000
dd[3] = 100000
if X==Y==1:
    print(1000000)
else:
    print(dd[X]+dd[Y])

Solution (Python):
X,Y=map(int,input().split())

def getMoney(n):
    if (n==1):
        return 300000
    elif (n==2):
        return 200000
    elif (n==3):
        return 100000
    else:
        return 0

base=0

if (X==1 and Y==1):
    base+=400000

base+=getMoney(X)
base+=getMoney(Y)

print(base)

Solution (Python):
INPUT=input()

X=int(INPUT.split()[0])
Y=int(INPUT.split()[1])

count=0

if X==1:
    count +=300000
elif X==2:
    count +=200000
elif X==3:
    count +=100000

if Y==1:
    count +=300000
elif Y==2:
    count +=200000
elif Y==3:
    count +=100000

if X==1 and Y==1:
    count +=400000

print(count)

Solution (Python):
A,B = [ int(x) for x in input().split()]

prize = [300000, 200000, 100000]

prize_all = 0
if A < 4:
    prize_all += prize[A - 1]
if B < 4:
    prize_all += prize[B - 1]

if A == 1 and B == 1:
    prize_all += 400000

print("{0}".format(prize_all))

Solution (Python):
x,y = map(int,input().split())
x1=0
y1=0

if x==1:
  x1=300000
elif x==2:
  x1=200000
elif x==3:
  x1=100000

if y==1:
  y1=300000
elif y==2:
  y1=200000
elif y==3:
  y1=100000
  
if x==1 and y==1:
  print(x1+y1+400000)
else:
  print(x1+y1)

Solution (Python):

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

ans = 0
if x == 3:
    ans += 100000
if y == 3:
    ans += 100000
if x == 2:
    ans += 200000
if y == 2:
    ans += 200000
if x == 1:
    ans += 300000
if y == 1:
    ans += 300000
if x == 1 and y == 1:
    ans += 400000
print(ans)

Solution (Python):
x,y=map(int,input().split())
z=[300000,200000,100000]

if x==1 and y==1:
    print(1000000)
else:
    k,l=0,0
    if 1<=x<=3:
         k=z[x-1]
    if 1<=y<=3:
         l=z[y-1]
    print(k+l)

Solution (Python):
X, Y = map(int, input().split())
ans = 0
if X == Y == 1:
    ans = 400000 + 300000 + 300000
else:
    if X == 1 or Y == 1:
        ans += 300000
    if X == 2:
        ans += 200000
    if Y == 2:
        ans += 200000
    if X == 3:
         ans += 100000
    if Y == 3:
        ans += 100000
print(ans)

Solution (Python):
import sys
x, y = map(int, input().split())
if x==1 and y==1:
    print(1000000)
    sys.exit()

def f(a):
    if a == 1:
        return 300000
    elif a == 2:
        return 200000
    elif a == 3:
        return 100000
    else:
        return 0

ans = f(x) + f(y)
print(ans)

Solution (Python):
N = list(map(int, input().split()))

ans = 0

if N[0] == 1:
    ans += 300000
elif N[0] == 2:
    ans += 200000
elif N[0] == 3:
    ans += 100000

if N[1] == 1:
    ans += 300000
elif N[1] == 2:
    ans += 200000
elif N[1] == 3:
    ans += 100000
    
if ans == 600000:
    ans += 400000


print(ans)

Solution (Python):
X, Y = map(int, input().split())
syoukin = [3*10**5, 2*10**5, 1*10**5]
if X == 1 and Y == 1:
    print(10*10**5)
else:
    money = 0
    if X <= 3:
        money += syoukin[X-1]
    if Y <= 3:
        money += syoukin[Y-1]
    print(money)

Solution (Python):
x,y = map(int,input().split())
one = 300000
two = 200000
three = 100000
tokubetu = 400000
xprize = 0
yprize = 0

if x==1:
    xprize = one
elif x==2:
    xprize = two
elif x==3:
    xprize = three
if y==1:
    yprize = one
elif y==2:
    yprize = two
elif y==3:
    yprize = three

if x==1 and y==1:
    print(xprize+yprize+tokubetu)
else:
    print(xprize+yprize)

Solution (Python):
x,y = map(int, input().split())
a = {1:300000 , 2:200000, 3: 100000}
ans =0
for i in range(1,4):
  if i == x:
    ans += a[i]
  if i == y:
    ans += a[i]
print(ans + (400000 if x == y and x == 1 else 0))

Solution (Python):
x,y=map(int,input().split())
if x==1 and y==1:
    print(1000000)
    exit()
a=[300000,200000,100000,0]
if x>3:
    x=0
if y>3:
    y=0
if x==0 and y==0:
    print(0)
    exit()
print(a[x-1]+a[y-1])

Solution (Python):
xy = list(map(int, input().split()))

x = xy[0]
y = xy[1]

if x == 1 and y == 1:
	ans = 400000
else:
	ans = 0

if x == 1:
	ans += 300000
if y == 1:
	ans += 300000
if x == 2:
	ans += 200000
if y == 2:
	ans += 200000
if x == 3:
	ans += 100000
if y == 3:
	ans += 100000

print(ans)

Solution (Python):
def test(n):
  m = 0
  if n == 3:
    m += 100000
  elif n == 2:
    m += 200000
  elif n == 1:
    m += 300000
  return m

x, y = map(int, input().split())
ans = test(x) + test(y)
if ans == 600000:
  ans += 400000

print(ans)

Solution (Python):
a,b=map(int,input().split())
p=0
if a==1:
  p+=300000
elif a==2:
  p+=200000
elif a==3:
  p+=100000

if b==1:
  p+=300000
elif b==2:
  p+=200000
elif b==3:
  p+=100000
if p==600000:
  p+=400000
print(p)

Solution (Python):
code,machine = map(int,input().split())
ans = 0
if code == 1 and machine == 1:
    ans += 400000
if code == 1:
    ans += 300000
elif code ==2:
    ans += 200000
elif code == 3:
    ans += 100000

if machine == 1:
    ans += 300000
elif machine ==2:
    ans += 200000
elif machine == 3:
    ans += 100000

print(ans)

Solution (Python):
X,Y=map(int,input().split())
prize = [0,3*10**5,2*10**5,10**5]
ans = 0
if X < 4:
    ans += prize[X]
if Y < 4:
    ans += prize[Y]
if X == 1 and Y == 1:
    ans += 4*10**5
print(ans)

Solution (Python):
x,y=map(int,input().split())
if x==1 and y==1:
    print(1000000)
elif x<=3 and y<=3:
    print((8-x-y)*100000)
elif x<=3:
    print((4-x)*100000)
elif y<=3:
    print((4-y)*100000)
else:print(0)

Solution (Python):
X,Y = map(int,input().split())
moneys = [0 for _ in range(3000)]
moneys[1] = 300000
moneys[2] = 200000
moneys[3] = 100000

answer = 0
answer += moneys[X]
answer += moneys[Y]
if (X==1 and Y==1):
    answer += 400000
print(answer)

Solution (Python):


def f(k):
    if k == 3:
        return 100000
    elif k == 2:
        return 200000
    elif k == 1:
        return 300000            
    else:
        return 0

def main():
    X, Y = map(int, input().split())

    print(f(X) + f(Y) + (400000 if X == 1 and Y == 1 else 0))


if __name__ == '__main__':
    main()

Solution (Python):
X,Y=map(int,input().split())
if X==1:
  if Y==1:
    print(1000000)
  elif Y==2:
    print(500000)
  elif Y==3:
    print(400000)
  else:
    print(300000)
elif X==2:
  if Y==1:
    print(500000)
  elif Y==2:
    print(400000)
  elif Y==3:
    print(300000)
  else:
    print(200000)
elif X==3:
  if Y==1:
    print(400000)
  elif Y==2:
    print(300000)
  elif Y==3:
    print(200000)
  else:
    print(100000)
else:
  if Y==1:
    print(300000)
  elif Y==2:
    print(200000)
  elif Y==3:
    print(100000)
  else:
    print(0)

Solution (Python):

def prize(n):
    if n == 1:
        return 300000
    elif n == 2:
        return 200000
    elif n == 3:
        return 100000
    else:
        return 0


x, y = map(int, input().split())
rst = prize(x) + prize(y)
if x == 1 and y == 1:
    rst += 400000
 
print(rst)

Solution (Python):
X, Y = map(int, input().split())
ans = 0
if (X <=3) | (Y <=3):
    if (X==1) & (Y==1):
        ans = 1000000
    else:
        ans = max((4-X), 0)*100000 + max((4-Y),0)*100000
else:
    ans = 0
    
print(ans)

Solution (Python):
import sys
readline = sys.stdin.readline
X, Y = map(int, readline().split())
res = 0
C = [0, 300000, 200000, 100000]
if X == Y == 1:
    res += 400000

if X > 3:
    X = 0
if Y > 3:
    Y = 0
res += C[X]
res += C[Y]
print(res)

Solution (Python):
X, Y = map(int, input().split())

a,b,c = 0,0,0

if X == 1 and Y == 1:
  c = 400000

if X == 1:
  a = 300000
elif X == 2:
  a = 200000
elif X == 3:
  a = 100000

if Y == 1:
  b = 300000
elif Y == 2:
  b = 200000
elif Y == 3:
  b = 100000

print(a+b+c)

Solution (Python):
def Solve (A, B):
    score = 0
    r = [A, B]
    for i in r:
        if i == '3':
            score += 1
        elif i == '2':
            score += 2
        elif i == '1':
            score += 3
    if A == '1' and B == '1':
        score += 4
    return score*100000
    

A, B = input().split()
print(Solve(A, B))

Solution (Python):


x, y = map(int, input().split())
total = 0
if x == 1 and y == 1:
    total += 400000
if x == 1:
    total += 300000
elif x == 2:
    total += 200000
elif x == 3:
    total += 100000
if y == 1:
    total += 300000
elif y == 2:
    total += 200000
elif y == 3:
    total += 100000

print(total)

Solution (Python):
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

def aa(num):
    if num==1:
        return 300000
    if num==2:
        return 200000
    if num==3:
        return 100000
    else:
        return 0
x,y = MAP()
ans=0
if x==1 and y==1:
    ans += 400000

ans += aa(x) + aa(y)
print(ans)

Solution (Python):
import sys

val = sys.stdin.readline()
x, y = val.split()
a = int(x)
b = int(y)
ans=0
if a==1 and b==1 :
    ans+=400000
ans+=max(4-a,0)*100000+max(4-b,0)*100000
print(ans)

Solution (Python):
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True 
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)


x,y = inm()
sum = 0
sum += (300000 if x==1 else 200000 if x==2 else 100000 if x==3 else 0)
sum += (300000 if y==1 else 200000 if y==2 else 100000 if y==3 else 0)
if x==1 and y==1:
    sum += 400000
print(sum)

Solution (Python):
import sys
import heapq
from collections import defaultdict
input = sys.stdin.readline

n = 100000

X, Y = map(int, input().split())
if X == 1 and Y == 1:
    print(1000000)
elif X <= 3 and Y <= 3:
    print((4 - X) * n + (4 - Y) * n)
elif X <= 3:
    print((4 - X) * n)
elif Y <= 3:
    print((4 - Y) * n)
else:
    print(0)

Solution (Python):
x,y=map(int,input().split())
x=0 if x>=4 else 4-x
y=0 if y>=4 else 4-y
print(1000000 if x==3 and y==3 else (x+y)*100000)

Solution (Python):
x, y = map(int, input().split())
ans = 0
if x == 1 :
    ans += 300000
elif x == 2:
    ans += 200000
elif x == 3:
    ans += 100000
if y == 1 :
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000
if x == 1 and y == 1:
    ans += 400000
print(ans)

Solution (Python):
X, Y = map(int, input().split())
get = 0

if X == 1:
    get += 300000
if X == 2:
    get += 200000
if X == 3:
    get += 100000
if Y == 1:
    get += 300000
if Y == 2:
    get += 200000
if Y == 3:
    get += 100000
if X == 1 and Y == 1:
    get += 400000

print(get)

Solution (Python):

"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect
import heapq


def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    



X, Y = list(map(int, input().split()))

    
def main():
    res = 0
    if X == 3:
        res += 10**5
    elif X == 2:
        res += 2*10**5
    elif X == 1:
        res += 3*10**5
        if Y == 1:
            res += 7*10**5
    if Y == 3:
        res+= 10**5
    elif Y == 2:
        res+= 2*10**5
    elif Y == 1 and X != 1:
        res += 3*10**5
    print(res)
                
                
                
            
            
                

    
if __name__ == '__main__':
    main()



"""
N, X = map(int, input().split())

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

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())


all(nstr.count(c) for c in '753')


ABT = zip(A, B, totAB)

A, B, totAB = zip(*ABT)


(x >> i) & 1


dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break

add = 1 
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)


li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    


org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)




    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""

Solution (Python):
x,y = map(int,input().split())
ans = 0
if x <=3:
  ans += (4-x)*100000
if y <=3:
  ans += (4-y)*100000
if x==1 and y==1:
  ans += 400000
print(ans)

Solution (Python):
def main():
    
    ''' Cook your dish here! '''
    x, y = get_list()
    res = 100000 * (4-x) if x<=3 else 0
    res += 100000 * (4-y) if y<=3 else 0
    if x==1 and y==1: res += 400000
    print(res)


''' Coded with love at India by Satyam Kumar '''
import sys

import math

out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()

print(*out, sep='\n')

Solution (Python):
a,b = map(int,input().split())
c = 0
if a == 3:
    c += 1
elif a == 2:
    c += 2
elif a == 1:
    c += 3

if b == 3:
    c += 1
elif b == 2:
    c += 2
elif b == 1:
    c += 3

if a == b == 1:
    c += 4

print(c*100000)

Solution (Python):
X, Y = map(int, input().split())

KANE = [
    300000,
    200000,
    100000
]
ans=0
if X <= 3:
    ans += KANE[X-1]
    
if Y <= 3:
    ans += KANE[Y-1]
    
if X == 1 and Y == 1:
    ans += 400000 
    
print(ans)

Solution (Python):
x, y = map(int, input().split())
ans = 0
if x == 1:
    ans += 300000
elif x == 2:
    ans += 200000
elif x == 3:
    ans += 100000

if y == 1:
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000

if x == 1 and y == 1:
    ans += 400000

print(ans)

Solution (Python):
X, Y = map(int, input().split())

M = 0

if X == 1:
    M += 300000
elif X == 2:
    M += 200000
elif X == 3:
    M += 100000
else:
    pass

if Y == 1:
    M += 300000
elif Y == 2:
    M += 200000
elif Y == 3:
    M += 100000
else:
    pass

if X == 1 and Y == 1:
    M = 1000000

print(M)

Solution (Python):
x, y = [int(i) for i in input().split()]
mon = 0
money = [300000, 200000, 100000]
if x -1 < 3:
    mon += money[x-1]
if y -1 < 3:
    mon += money[y-1]
if x == y and x == 1:
    mon += 400000
print(mon)

Solution (Python):
x, y=(int(i) for i in input().split())
a=[1,2,3]
sc=0
if x<4:
	sc+=4-x
if y<4:
	sc+=4-y
if x==1 and x==y:
	sc+=4
print(sc*100000)

Solution (Python):
n,m=map(int,input().split())
ans=0
if(n==3):
  ans+=1
if(n==2):
  ans+=2
if(n==1):
  ans+=3
if(m==3):
  ans+=1
if(m==2):
  ans+=2
if(m==1):
  ans+=3
  
if(n==1 and m==1):
  ans+=4
  
print(ans*100000)

Solution (Python):
x, y = list(map(int, input().split()))
ans = 0
if x  == 1 and y == 1:
  ans += 400000
if x == 1:
  ans += 300000
elif x == 2:
  ans += 200000
elif x == 3:
  ans += 100000
if y == 1:
  ans += 300000
elif y == 2:
  ans += 200000
elif y == 3:
  ans += 100000
print(ans)

Solution (Python):
X, Y = map(int, input().split())
money = 0

if X == 1:
  money += 300000
elif X == 2:
  money += 200000
elif X == 3:
  money += 100000

if Y == 1:
  money += 300000
elif Y == 2:
  money += 200000
elif Y == 3:
  money += 100000


if X == 1 and Y ==1:    
    money += 400000

print(money)

Solution (Python):
x, y = map(int, input().split())
ans = 0
if x == 1:
    ans += 300000
elif x == 2:
    ans += 200000
elif x == 3:
    ans += 100000

if y == 1:
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000

if x == y == 1:
    ans += 400000
print(ans)

Solution (Python):
x,y = (int(i) for i in input().split())
ans = 0
if x == 1:
    ans += 300000
    if y == 1:
        ans += 400000
elif x == 2:
    ans += 200000
elif x == 3:
    ans += 100000
if y == 1:
    ans += 300000
elif y == 2:
    ans += 200000
elif y == 3:
    ans += 100000
print(ans)

Solution (Python):
X, Y = map(int, input().split())
r = 0
if(X == 1):
  r += 300000
elif(X == 2):
  r += 200000
elif(X == 3):
  r += 100000
else:
  pass

if(Y == 1):
  r += 300000
elif(Y == 2):
  r += 200000
elif(Y == 3):
  r += 100000
else:
  pass

if(X == Y == 1):
  r += 400000

print(r)

Solution (Python):
x, y = map(int, input().split())
c = [0] * 206
c[1] = 300000
c[2] = 200000
c[3] = 100000
ans = c[x] + c[y]
if x == 1 and y == 1:
    print(ans + 400000)
else:
    print(ans)

Solution (Python):
import sys
x,y = map(int, input().split())
ans = 0

if(x == 1 and y == 1):
  print(1000000)
  sys.exit()

if(x == 3):
  ans += 100000
elif(x == 2):
  ans += 200000
elif(x == 1):
  ans += 300000
  
if(y == 3):
  ans += 100000
elif(y == 2):
  ans += 200000
elif(y == 1):
  ans += 300000
  
print(ans)

Solution (Python):
X,Y = map(int,input().split())

ans = 0
m1 = 300000
m2 = 200000
m3 = 100000
for i in [X,Y]:
  if i == 1:
    ans += m1
  elif i == 2:
    ans += m2
  elif i == 3:
    ans += m3

if X==1 and Y == 1:
  ans += 400000

print(ans)

Solution (Python):
x,y = map(int,input().split())
l = [0,300000,200000,100000]
alpha = 400000
ans = 0
if x == 1 and y == 1:
  ans = l[1]*2 + alpha
  print(ans)
else:
  if 1 <= x <= 3:
    ans += l[x]
  if 1 <= y <= 3:
    ans += l[y]  
  print(ans)

Solution (Python):
x,y=map(int,input().split())

ans=0
if x==1 and y==1:
  ans+=400000
if x==1:
  ans+=300000
if y==1:
  ans+=300000
if x==2:
  ans+=200000
if y==2:
  ans+=200000
if x==3:
  ans+=100000
if y==3:
  ans+=100000
print(ans)

Solution (Python):
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math

d = [int(s) for s in stdin.readline().rstrip().split()]
x = d[0]
y = d[1]
res = 0
if x == 1:
    res += 300000
elif x == 2:
    res += 200000
elif x == 3:
    res += 100000

if y == 1:
    res += 300000
elif y == 2:
    res += 200000
elif y == 3:
    res += 100000
if x == 1 and y == 1:
    print(1000000)
else:
    print(res)

Solution (Python):
x,y=map(int,input().split())
ans=0
if x==1 and y==1:
    ans+=400000
if x==3:
    ans+=100000
if x==2:
    ans+=200000
if x==1:
    ans+=300000
if y==3:
    ans+=100000
if y==2:
    ans+=200000
if y==1:
    ans+=300000
print(ans)

Solution (Python):
x,y=map(int,input().split())
m=0
if x==1:
    m+=300000
elif x==2:
    m+=200000
elif x==3:
    m+=100000

if y==1:
    m+=300000
elif y==2:
    m+=200000
elif y==3:
    m+=100000

if x==1 and y==1:
    m+=400000

print(m)

Solution (Python):
X, Y = map(int, input().split())

def money(n):
  ret = 0
  if n == 1:
    ret = 300000
  elif n == 2:
    ret = 200000
  elif n == 3:
    ret = 100000
  
  return ret 

ans = 0
ans += money(X) + money(Y)
if X == 1 and Y == 1:
  ans += 400000
print(ans)

Solution (Python):
x,y=map(int,input().split())
cnt=0
for i in (x,y):
    if i==3:cnt +=1
    elif i==2:cnt +=2
    elif i==1:cnt +=3

print((cnt+4)*10**5 if x==y==1 else cnt*10**5)

Solution (Python):


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

result = 0

if x == 1:
    result += 300000
elif x == 2:
    result += 200000
elif x == 3:
    result += 100000

if y == 1:
    result += 300000
elif y == 2:
    result += 200000
elif y == 3:
    result += 100000
    
if x == 1 and y == 1:
    result += 400000
    
print(result)

Solution (Python):
x, y = map(int, input().split())

ans = 0
p = [0, 300000, 200000, 100000] + [0] * 205


ans = p[x] + p[y]


if x == 1 and y == 1:
    ans += 400000

print(ans)

Solution (Python):
X, Y = map(int, input().split())
l = [300000, 200000, 100000]
a = 400000
ans = 0
if X <= 3:
    ans += l[X - 1]
if Y <= 3:
    ans += l[Y - 1]
if X == 1 and Y == 1:
    ans += a
print(ans)

Solution (Python):
X,Y=map(int,input().split())

ans=0

if X==1:
    ans+=300000
if X==2:
    ans+=200000
if X==3:
    ans+=100000
if Y==1:
    ans+=300000
if Y==2:
    ans+=200000
if Y==3:
    ans+=100000
if X==1 and Y==1:
    ans+=400000

print(ans)

Solution (Python):
X, Y = map(int, input().split())
ret = 0
if X == 1:
    ret += 300000
elif X == 2:
    ret += 200000
elif X == 3:
    ret += 100000

if Y == 1:
    ret += 300000
elif Y == 2:
    ret += 200000
elif Y == 3:
    ret += 100000
if X == 1 and Y == 1:
    ret += 400000
print(ret)

Solution (Python):
X, Y = [int(v) for v in input().split()]

v = 0

if X == 1 and Y == 1:
    v += 400000

def prize(rank):
    if rank == 3:
        return 100000
    elif rank == 2:
        return 200000 
    elif rank == 1:
        return 300000
    else:
        return 0
 
v += prize(X) + prize(Y)
print(v)

Solution (Python):
def getmoney(p: int):
    if p == 3:
        return 100000

    elif p == 2:
        return 200000

    elif p == 1:
        return 300000

    else:
        return 0


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

money = getmoney(x) + getmoney(y)

if x == 1 and y == 1:
    print(money + 400000)
else:
    print(money)

Solution (Python):
ans = 0
num = list(map(int,input().split()))
for i in range(2):
    if num[i] == 1:
        ans += 300000
    elif num[i] == 2:
        ans += 200000
    elif num[i] == 3:
            ans += 100000
if num[1] == num[0] == 1:
    ans += 400000
print(ans)

Solution (Python):
"""
NTC here
"""
from sys import stdin, setrecursionlimit
setrecursionlimit(10**7)

def iin(): return int(stdin.readline())
 
 
def lin(): return list(map(int, stdin.readline().split()))



def main():
    x,y=lin()
    ans=[0,3,2,1]
    sol=0
    if x<4:sol+=ans[x]
    if y<4:sol+=ans[y]
    if x==y==1:sol+=4
    print(sol*100000)
    



    
                











main()

Solution (Python):
x,y=map(int,input().split())
a=0
if x==3:
    a+=1
if y==3:
    a+=1
if x==2:
    a+=2
if y==2:
    a+=2
if x==1:
    a+=3
if y==1:
    a+=3
if x==1 and y==1:
    a+=4
print(a*100000)

Solution (Python):


a,b = map(int,input().split())

rank_dic = {1:300000,2:200000,3:100000}

if a == 1 and b ==1:
    print(1000000)
    exit()

ans = 0
try:
    ans += rank_dic[a]
except:
    pass

try:
    ans += rank_dic[b]
except:
    pass

print(ans)

Solution (Python):
import sys
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

x, y = IL()

if x == y == 1:
  print(1000000)
  exit()

ans = 0
if x == 1:
  ans += 300000
elif x == 2:
  ans += 200000
elif x == 3:
  ans += 100000

if y == 1:
  ans += 300000
elif y == 2:
  ans += 200000
elif y == 3:
  ans += 100000
print(ans)

Solution (Python):
rank=list(map(int, input().split()))

ans=0
for x in rank:
    if(x==3):
        ans+=100000
    elif(x==2):
        ans+=200000
    elif(x==1):
        ans+=300000

if(ans==600000):
    ans+=400000
print(ans)

Solution (Python):
X,Y=map(int, input().split())
ans=0

if X==1:
    ans+=300000
elif X==2:
    ans+=200000
elif X==3:
    ans+=100000
    
if Y==1:
    ans+=300000
elif Y==2:
    ans+=200000
elif Y==3:
    ans+=100000

if X==1 and Y==1:
    ans+=400000

print(ans)

Solution (Python):

import sys

def main():
    xy = map(int, sys.stdin.readline().split())
    ans = 0
    for i in xy:
        if i == 1:
            ans += 3 * 10 ** 5
        if i == 2:
            ans += 2 * 10 ** 5
        elif i == 3:
            ans += 1 * 10 ** 5
    
    if ans == 6 * 10 ** 5:
        ans = 1 * 10 ** 6
    
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):

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

if x>3 :
    if y>3:
        print(0)
        exit()
    elif y==3:
        print(100000)
        exit()
    elif y==2:
        print(200000)
        exit()
    elif y==1:
        print(300000)
        exit()
elif x==3:
    if y > 3:
        print(100000)
        exit()
    elif y == 3:
        print(200000)
        exit()
    elif y == 2:
        print(300000)
        exit()
    elif y == 1:
        print(400000)
        exit()
elif x==2:
    if y > 3:
        print(200000)
        exit()
    elif y == 3:
        print(300000)
        exit()
    elif y == 2:
        print(400000)
        exit()
    elif y == 1:
        print(500000)
        exit()

elif x==1:
    if y > 3:
        print(300000)
        exit()
    elif y == 3:
        print(400000)
        exit()
    elif y == 2:
        print(500000)
        exit()
    elif y == 1:
        print(1000000)
        exit()

Solution (Python):
x, y = map(int, input().split())
ans = 0
if x <= 3:
    ans += 400000 - x * 100000
if y <= 3:
    ans += 400000 - y * 100000
if x == y == 1:
    ans += 400000
print(ans)

Solution (Python):
list = [int(i) for i in input().split()]

ans = 0
for i in list:
    if i==1:
        ans += 300000
    elif i==2:
        ans += 200000
    elif i==3:
        ans += 100000
if list[0]==1 and list[1]==1:
    ans += 400000
print(ans)

Solution (Python):
n,m = 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))

Solution (Python):
import sys

input = sys.stdin.readline

class AtCoder:
    def main(self):
        X, Y = map(int, input().split())

        ans = 0
        if X == 3:
            ans += 100000
        elif X == 2:
            ans += 200000
        elif X == 1:
            ans += 300000

        if Y == 3:
            ans += 100000
        elif Y == 2:
            ans += 200000
        elif Y == 1:
            ans += 300000

        if X == 1 and Y == 1:
            ans += 400000

        print(ans)



if __name__ == '__main__':
    AtCoder().main()

Solution (Python):
X,Y = map(int,input().split(' '))

count_sum = 0

def count_money(X,count_sum):
    if X == 1:
        count_sum += 300000
    elif X ==2:
        count_sum += 200000
    elif X ==3:
        count_sum += 100000
    return count_sum

count_sum = count_money(X,count_sum)
count_sum = count_money(Y,count_sum)
if X == 1 and Y ==1:
    count_sum += 400000
print(count_sum)

Solution (Python):
x, y = (int(_) for _ in input().split())
mon = {1:3, 2:2, 3:1}
if x == 1 and y == 1:
    print((3 + 3 + 4)*10**5)
elif x < 4 and y < 4:
    print((mon[x] + mon[y])*10**5)
elif x < 4:
    print(mon[x]*10**5)
elif y < 4:
    print(mon[y]*10**5)
else:
    print(0)

Solution (Python):
X,Y = map(int,input().split())
if X == 1 and Y == 1:
    print(1000000)
    exit()
bumon = [X,Y]
man = 0
for i in bumon:
    if i == 1:
        man += 300000
    if i == 2:
        man += 200000
    if i == 3:
        man += 100000

print(man)

Solution (Python):
a = list(map(int, input().split()))

i = 0
if i == 0:
    r = 0
    if a[0]==1 and a[1] == 1:
        r += 400000
    if a[1] ==1:
        r += 300000
    elif a[1] == 2:
        r += 200000
    elif a[1] == 3:
        r += 100000
    if a[0] ==1:
        r += 300000
    elif a[0] == 2:
        r += 200000
    elif a[0] == 3:
        r += 100000
    print(r)

Solution (Python):
x, y = map(int, input().split())
ans = 0
for i in (x, y):
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000
if x == y == 1:
    ans += 400000
print(ans)

Solution (Python):

import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

A=list(map(int,input().split()))
for ai in A:
    if ai==1:
        ans+=300000
    elif ai==2:
        ans+=200000
    elif ai==3:
         ans+=100000
if A[0]==1 and A[1]==1:
    ans+=400000
print(ans)