#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cout << fixed << setprecision(12);
  string s;
  cin >> s;
  double n = s.size();
  vector<long long> alpha[26];
  for (long long i = 0; i < n; i++) alpha[s[i] - 'a'].push_back(i);
  double ans = 0;
  for (long long i = 0; i < 26; i++) {
    double temp = 0;
    for (long long shift = 0; shift < n; shift++) {
      long long cnt[26] = {0};
      for (auto idx : alpha[i]) cnt[s[(idx + shift) % ((long long)n)] - 'a']++;
      long long temp2 = 0;
      for (long long j = 0; j < 26; j++)
        if (cnt[j] == 1) temp2++;
      temp = max(temp, temp2 / n);
    }
    ans += temp;
  }
  cout << ans;
}
