from collections.abc import Iterable def accum_dp(xs: Iterable, f, op, e, init: dict, *, is_reset=True): dp = init.copy() for x in xs: pp = {} if is_reset else dp.copy() dp, pp = pp, dp for fm_key, fm_val in pp.items(): for to_key, to_val in f(fm_key, fm_val, x): dp[to_key] = op(dp.get(to_key, e), to_val) return dp def op(a, b): return (a + b) % MOD def f(k, v, x): lz, lt, m = k # (leading zero, 未満か, mod) for d in range(10): if not lt and d > x: break nlz = lz and d == 0 nlt = lt or d < x if nlz: yield (nlz, nlt, m), v elif d > 0: nm = m * d % 100 yield (nlz, nlt, nm), v def digit_dp() -> int: digits = [int(c) for c in N] init = {(True, False, 1): 1} dp = accum_dp(digits, f, op, 0, init) res = 0 for (lz, _, m), v in dp.items(): if not lz and m == 0: res += v return res MOD = 10**9 + 7 N = input() ans = digit_dp() print(ans)