S=input() ANS=0 mod=998244353 for i in range(len(S)): ANS=ANS*11+int(S[i])*pow(2,i,mod) ANS%=mod print(ANS)