#ifdef SENJAN #define _GLIBCXX_DEBUG #else #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #endif #include #include #include using namespace std; using namespace atcoder; using ll=long long; using ull=unsigned long long; using ld=long double; using bint = boost::multiprecision::cpp_int; using graph=vector>; template using min_priority_queue=priority_queue,greater>; constexpr int INF32=INT_MAX/2; constexpr ll INF64=LLONG_MAX/2; constexpr ld PI=3.14159265358979323846; constexpr int dx[]={0,0,-1,1,-1,-1,1,1},dy[]={-1,1,0,0,-1,1,-1,1}; template inline bool chmax(T &a,T b){return a inline bool chmin(T &a,T b){return a>b?a=b,true:false;} inline void dispYN(bool a){cout<<(a?"YES":"NO")<sync_with_stdio(0);cout<> s; int n = s.length(); vector dp(n+1, vector(26, vector(3))); auto idx = [&](char c){ return c-'A'; }; ll ans = 0; for(int i=0; i<26; i++){ dp[0][i][0] = 1; } for(int i=0; i