#include "bits/stdc++.h" #include "atcoder/all" using namespace std; using namespace atcoder; using mint = modint1000000007; const int mod = 1000000007; //using mint = modint998244353; //const int mod = 998244353; //const int INF = 1e9; //const long long LINF = 1e18; #define rep(i, n) for (int i = 0; i < (n); ++i) #define rep2(i,l,r)for(int i=(l);i<(r);++i) #define rrep(i, n) for (int i = (n-1); i >= 0; --i) #define rrep2(i,l,r)for(int i=(r-1);i>=(l);--i) #define all(x) (x).begin(),(x).end() #define allR(x) (x).rbegin(),(x).rend() #define endl "\n" mint dp[100002][2][100][2][2]; //桁,一致or不一致,mod100,0始まりかどうか,0が出たかどうか //mint f(int i, int j, int k, int l, int m) { //return dp[ni][nj][nk][nl][]; //} int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string N; cin >> N; dp[0][0][0][1][0] = 1; rep(i, N.size()) { //配るdp rep(j, 2) { rep(k, 100) { rep(l, 2) { rep(m, 2) { if (0 == j) { int num = N[i] - '0'; //一致->一致 { int n = num; int ni = i + 1; int nj = 0; int nk = (k * n) % 100; if (1 == l) { nk = n; } int nl = 0; if ((1 == l) && (0 == n)) { nl = 1; } int nm = m; if ((0 == num) && (1 != nl)) { nm = min(1, m + 1); } dp[ni][nj][nk][nl][nm] += dp[i][j][k][l][m]; } //一致->不一致 rep(n, num) { int ni = i + 1; int nj = 1; int nk = (k * n) % 100; if (1 == l) { nk = n; } int nl = 0; if ((1 == l) && (0 == n)) { nl = 1; } int nm = m; if ((0 == n) && (1 != nl)) { nm = min(1, m + 1); } dp[ni][nj][nk][nl][nm] += dp[i][j][k][l][m]; } } else { //不一致->不一致 rep(n, 10) { int ni = i + 1; int nj = 1; int nk = (k * n) % 100; if (1 == l) { nk = n; } int nl = 0; if ((1 == l) && (0 == n)) { nl = 1; } int nm = m; if ((0 == n) && (1 != nl)) { nm = min(1, m + 1); } dp[ni][nj][nk][nl][nm] += dp[i][j][k][l][m]; } } } } } } } mint ans = 0; rep(i, 2) { ans += dp[N.size()][i][0][0][0]; } cout << ans.val() << endl; return 0; }