mod = 10**9 + 7 n = input() l = len(n) dp0 = [[0] * 100 for i in range(l + 1)] dp1 = [[0] * 100 for i in range(l + 1)] for i in range(l): d = ord(n[i]) - ord('0') for j in range(100): dp0[i][j] %= mod dp1[i][j] %= mod for k in range(1, 10): newj = j * k % 100 if k == d: dp0[i + 1][newj] += dp0[i][j] if k < d: dp1[i + 1][newj] += dp0[i][j] if i: dp1[i + 1][k] += 1 elif k == d: dp0[i + 1][k] += 1 dp1[i + 1][newj] += dp1[i][j] print((dp0[l][0] + dp1[l][0]) * pow(100, -1, mod) % mod)