#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) typedef long long ll; typedef pair pint; typedef pair pli; const int inf=1e9+7; const ll longinf=1LL<<60 ; const ll mod=1e9+7 ; struct Xor128{ unsigned x,y,z,w; Xor128(unsigned w_=88675123):x(123456789),y(362436069),z(521288629),w(w_){}; inline unsigned xor128(){ unsigned t; t = x^(x<<11); x = y; y = z; z = w; return w = (w^(w>>19))^(t^(t>>8)); } int nextInt(int x,int y){ if(x>y)swap(x,y); return xor128()%(y-x)+x; } double nextDouble(double a,double b){ return (double)(xor128()&0xffff)/0xffff*(b-a)+a; } }; int main(){ string s; cin>>s; ll n=s.size(); auto rnd=Xor128(); set st; ll sum=0; rep(i,200000){ int l=rnd.nextInt(0, n); int r=rnd.nextInt(1, n+1); if(l==r)continue; if(l>r)swap(l,r); if(st.count(n*r+l))continue; st.insert(n*r+l); int cnt=0; vector c(26); REP(i,l,r){ if(++c[s[i]-'a']==1)++cnt; if(cnt==26)break; } sum+=cnt; if(st.size()==n*(n+1)/2)break; } cout<<1.0*sum/st.size()<