#include #include #include using namespace std; using mint=atcoder::modint998244353; mint dp[2][2][3]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string N;cin>>N; int now=0; dp[now][0][0]=1; for(char c:N) { int nxt=1-now; for(int i=0;i<2;i++)for(int j=0;j<3;j++) { dp[nxt][i][j]=0; } for(int i=0;i<2;i++) { int U=i?9:c-'0'; for(int k=0;k<=U;k++) { int ni=i||k