#include <bits/stdc++.h>
using namespace std;
const int nmax = 3e5;
const int omega = 30;
long long ans[nmax + 1];
int lst[omega + 1];
int main() {
  cin.sync_with_stdio(false);
  cin.tie();
  cout.tie();
  string s;
  cin >> s;
  int n = (int)s.size();
  for (int i = 0; i < omega; ++i) lst[i] = -1;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    lst[s[i] - 'a'] = i;
    vector<int> v;
    for (int j = 0; j < 26; ++j) {
      if (lst[j] != -1) v.push_back(lst[j]);
    }
    v.push_back(-1);
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    cnt = (int)v.size() - 1;
    for (int j = 1; j < (int)v.size(); ++j) {
      ans[j] += (v[j - 1] - v[j]);
    }
  }
  cout << cnt << "\n";
  for (int i = 1; i <= 26 && ans[i] != 0; ++i) {
    cout << ans[i] << "\n";
  }
  return 0;
}
