#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll INF=1LL<<60; typedef pair P; typedef pair PP; const ll MOD=998244353; int main(){ int N; cin>>N; string S; cin>>S; /* dp[i][j][k]=i文字目がk, i-1文字目がj */ vector dp(N+1,vector>(26,vector(26,0))); for(int j=0;j<26;j++){ if( !(S[0]-'a' == j || S[0]=='?') )continue; for(int k=0;k<26;k++){ if( !(S[1]-'a'==k || S[1]=='?') || k==j ) continue; dp[1][j][k]=1; } } for(int i=2;i