#include using namespace std; using ll=long long; using pll=pair; using tll=tuple; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for (ll i=0;i<(ll)(n);i++) #define all(v) v.begin(),v.end() template inline bool chmin(T &a,T b){ if(a>b){ a=b; return true; } return false; } template inline bool chmax(T &a,T b){ if(a using mint=atcoder::modint998244353; mint dp[10010][2][2][1<<10]; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); string s; cin >> s; ll n=(ll)s.size(); dp[0][0][0][0]=1; rep(i,n){ rep(j,1<<10){ rep(k,10){ rep(l,2){ ll x=l|(k!=0),y=j; if(x==1) y^=1<