s=input()
dic={'B':2,'D':10,'H':16}
st=['']*100
top=-1
i=x=m=0
while i<len(s):
if s[i]=='+' or s[i]=='=':
__________
__________
t=0
while top!=-1:
if st[top]>='A' and st[top]<='F':
st[top]=ord(st[top])-ord('A')+10
x=__________
t=t+1
top=top-1
else:
__________
__________
i=i+1
print(x)