import re while~0:*a,=range(10);exec(re.sub('\d','a[\g<0>]',input()));print(ans)