n = input() mod = 10**9+7 le = len(n) dp = [[[0]*2 for i in range(100)] for j in range(le+1)] dp[0][1][1] = 1 for i in range(le): x = int(n[i]) for j in range(100): for k in range(1,10): if k < x: dp[i+1][(j*k)%100][0] += dp[i][j][1] if k == x: dp[i+1][(j*k)%100][1] += dp[i][j][1] dp[i+1][(j*k)%100][1] %= mod dp[i+1][(j*k)%100][0] += dp[i][j][0] dp[i+1][(j*k)%100][0] %= mod dp[i+1][1][0] += 1 print(sum(dp[-1][0])%mod)