#include using namespace std; #define ALL(a) (a).begin(),(a).end() #define ALLR(a) (a).rbegin(),(a).rend() #define spa << " " << #define test cout<<"test"<; void chmin(ll &a,ll b){if(a>b)a=b;} void chmax(ll &a,ll b){if(a>v,ll h,ll w){for(ll i=0;iv,ll h,ll w){for(ll i=0;iv,ll n){cout<second++; int main(){ ll res=0,res1=INF,res2=-INF,buf=0; bool judge = true; string s;cin>>s; ll n=s.size(); res=n*(n+1)/2*26; rep(i,0,26){ buf=-1; char bufc='a'+i; rep(j,0,n){ if(s[j]==bufc){ ll cnt=j-buf-1; res-=(cnt)*(cnt+1)/2; buf=j; } } ll cnt=n-buf-1; res-=(cnt)*(cnt+1)/2; } ld x=n; cout<