//#include > #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define pt(sth) cout << sth << "\n" using namespace std; //#include //using namespace atcoder; typedef long long ll; typedef pair pll; templatebool chmax(T &a, const T &b) {if(abool chmin(T &a, const T &b) {if(b>a[i]; typedef vector v1D; typedef vector v2D; typedef vector v3D; ll mop(ll x, ll n) { ll res=1; while(n>0) { if(n&1) (res*=x)%=MOD; (x*=x)%=MOD; n>>=1; } return res; } v3D dp(MAX/10,v2D(100,v1D(2,0))); int main(void) { ll i, j, k; string s;cin>>s; ll N=s.size(); dp[1][s[0]-'0'][1]=1; for(i=1;i0 for(k=1;k<10;k++){ (dp[i+1][(j*k)%100][0]+=dp[i][j][0])%=MOD; } //1->0 for(k=1;k1 if(max) (dp[i+1][(j*max)%100][1]+=dp[i][j][1])%=MOD; } } ll ans=(dp[N][0][0]+dp[N][0][1])%MOD; for(i=2;i<=N-1;i++){ ll s=mop(9, i); ll a50=mop(8, i); ll a51=i*mop(8,i-1)%MOD; ll a20=mop(5, i); ll a21=i*2*mop(5,i-1)%MOD; ll c=mop(4,i); ll d=i*mop(4,i-1)%MOD; ll d2=i*2*mop(4,i-1)%MOD; ll e=i*2*(i-1)%MOD*mop(4,i-2)%MOD; (ans+=(s-a50-a51-a20-a21+c+d+d2+e+MOD*4))%=MOD; } pt(ans); }