import re while 1:*v,=range(10);exec(re.sub('(\d)',r'v[\1]',input()));print(ans)