#include #include using namespace std; using namespace atcoder; using ll = int; #define rep(i, a, b) for(ll i=a; i=b; i--) using mint = modint998244353; int main() { ios::sync_with_stdio(false); std::cin.tie(nullptr); // cout << fixed << setprecision(18); string s; cin>>s; ll n = s.size(); vector>>> dp(n+1, vector>>(1<<10, vector>(2, vector(2)))); dp[n][0][1][1] = 1; rrep(i,n,1){ ll now = s[n-i]-'0'; rep(j,0,1<<10){ rep(mode,0,2){ rep(l,0,2){ if (mode){ rep(k,0,10){ if (l){ if (k