#include using namespace std; using ll=long long; int main(){ string s; cin >> s; vector dp(4); dp[0]=1; for(auto& c : s){ vector ndp=dp; if(c=='?'){ for(auto& x : ndp) x=(x*2)%998244353; } if(c!='1'){ ndp[1]=(ndp[1]+dp[0])%998244353; ndp[3]=(ndp[3]+dp[2])%998244353; } if(c!='0'){ ndp[2]=(ndp[2]+dp[1])%998244353; } swap(ndp,dp); } cout<