#include <bits/stdc++.h>
using namespace std;
char s[5500];
int n;
int ans[5050];
int na;
int pp;
void parse() {
  pp += 7;
  int k = na;
  na++;
  while (s[pp + 2] == 'r') {
    pp += 4;
    while (s[pp + 2] == 'd') {
      ans[k]++;
      pp += 4;
      if (s[pp + 1] != '/') parse();
      pp += 5;
    }
    pp += 5;
  }
  pp += 8;
}
int main() {
  char c;
  while (cin >> c) s[n++] = c;
  parse();
  sort(ans, ans + na);
  cout << ans[0];
  for (int i = 1; i < na; i++) cout << ' ' << ans[i];
  cout << endl;
  return 0;
}
