from functools import lru_cache @lru_cache(None) def f(N): if N<=9: return N*(N+1)//2 q,r=divmod(N,10) a=r*(r+1)//2 b=(10+r)*(9-r)//2 return ((1+f(q))*a+(1+f(q-1))*b)%Mod N=int(input()) Mod=10**9+7 N_str=[int(n) for n in str(N)] M=0 for n in N_str: M=10*M+n _=f(M); _=f(M-1); print(f(N))