MOD=998244353 S=input().rstrip() res=0 cnt=1 for s in S: res+=res*10+int(s)*cnt cnt*=2 cnt%=MOD res%=MOD print(res)