#include using namespace std; #define int long long signed main(){ string S; cin>>S; int N = S.size(); vector> R(26,vector(N+1)); for(int i=0;i