#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod=998244353;
int digdig(int n)
{
int res=0;
while(n)
{
++res;
n/=10;
}
return res;
}
int mult(int a,int b)
{
int res=0;
while(b)
{
if(b&1)
res=(res+a)%mod;
a=(a+a)%mod;
b>>=1;
}
return res;
}
int fpow(int a,int b)
{
int res=1;
while(b)
{
if(b&1)
res=mult(res,a);
a=mult(a,a);
b>>=1;
}
return res;
}
int inv(int x){return fpow(x,mod-2);}
signed main()
{
int n;
cin>>n;
int k=fpow(10,digdig(n));
int i=(fpow(k,n)%mod-1)*inv(k-1)%mod;
cout<<n*i%mod;
}