import sys input = sys.stdin.readline mod=998244353 N=int(input()) from functools import lru_cache @lru_cache(maxsize=None) def calc(x): if x<8: return 0 if x==8 or x==9: return 1 ANS=1+(x-8)//10 for i in [0,1,2,3,4,5,6,7,9]: ANS+=calc((x-i)//10) ANS%=mod return ANS print(calc(N)%mod)