#include using namespace std; #include using namespace atcoder; using mint=modint1000000007; using ll=long long; using pp=pair; #define sr string #define vc vector #define fi first #define se second #define rep(i,n) for(ll i=0;i<(ll)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ sr s;cin>>s; vc dp(3,vc(3,0)); int ta=0,tb=0;bool ok=true,fir=true; for(char c:s){ int x=c-'0'; vc pre(3,vc(3,0)); swap(pre,dp); if(x==0)ok=false; if(!fir){ dp[0][0]+=4; dp[1][0]+=2; dp[0][1]++; dp[2][0]+=2; } if(ok)for(int i=1;i