#include using namespace std; #include using namespace atcoder; using ll=long long; using Graph=vector>; #define MAX 2000000 #define MOD 998244353 #define INF 1000000000 int main(){ int N; string S; cin>>N>>S; if(N==1){ if(S[0]=='?'){ cout<<26<<'\n'; }else{ cout<<1<<'\n'; } return 0; } vector>> dp(N,vector>(26,vector(26,0))); if(S[0]=='?'&&S[1]=='?'){ for(int j=0;j<26;j++){ for(int k=0;k<26;k++){ if(j==k){ continue; } dp[1][j][k]=1; } } }else if(S[0]=='?'){ for(int j=0;j<26;j++){ if(j==S[1]-'a'){ continue; } dp[1][j][S[1]-'a']=1; } }else if(S[1]=='?'){ for(int k=0;k<26;k++){ if(S[0]-'a'==k){ continue; } dp[1][S[0]-'a'][k]=1; } }else{ if(S[0]!=S[1]){ dp[1][S[0]-'a'][S[1]-'a']=1; } } for(int i=2;i