a=input().split() x=int(a[0]) y=int(a[1]) p=0 if y!=0 and x!=0: if y>x: p+=x*90 y=y-x else: p+=y*90 x=x-y p+=x*60+y*40 print(p)