#include using namespace std; using ll = long long; #define rep(i,n) for (int i=0;i<(int)(n);i++) int main(){ int n; cin>>n; string s; cin>>s; ll ans=0; int up=n; int dw=-1; while(up-dw>2){ int md1=(up+up+dw)/3,md2=(up+dw+dw)/3; ll nw1=0,nw2=0; { int ca=0; rep(i,n){ if(s.at(i)=='?'){ if(i