#include <bits/stdc++.h>
using namespace std;
string s;
string s1;
int a[5005];
int q[5005];
bool vis[5005];
int main() {
  while (cin >> s1) s = s + s1;
  int l = s.size();
  int cnt = 0;
  for (int i = 0; i < l;) {
    if (s[i + 2] == 'a') {
      a[cnt++] = 1;
      i += 7;
    } else if (s[i + 2] == 'r') {
      a[cnt++] = 2;
      i += 4;
    } else if (s[i + 2] == 'd') {
      a[cnt++] = 3;
      i += 4;
    } else if (s[i + 3] == 'a') {
      a[cnt++] = 4;
      i += 8;
    } else if (s[i + 3] == 'r') {
      a[cnt++] = 2;
      i += 5;
    } else if (s[i + 3] == 'd') {
      a[cnt++] = 3;
      i += 5;
    }
  }
  int r = -1, mm = -1;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < cnt; i++) {
    if (a[i] == 1) {
      q[++mm] = 0;
      r = mm;
    } else if (a[i] == 4) {
      vis[r] = 1;
      while (vis[r]) r--;
    } else if (a[i] == 3)
      q[r]++;
  }
  sort(q, q + mm + 1);
  for (int i = 0; i <= mm; i++) cout << q[i] / 2 << " ";
  cout << endl;
  return 0;
}
