#include <bits/stdc++.h>
using namespace std;
const int maxs = 5000 + 5;
int qty[maxs], st[maxs];
char a[maxs];
int main() {
  int i = 0;
  bool cnt = false;
  int table = 1, maxt = 0;
  while (table) {
    scanf("%c", &a[i]);
    if (a[i] == '\n' || a[i] == ' ') continue;
    if (i == 6) --table;
    if (a[i] == '>')
      if (a[i - 1] == 'e')
        if (a[i - 6] == '/')
          --table;
        else {
          st[table] = maxt;
          ++table;
          ++maxt;
        }
      else if (a[i - 1] == 'd' && a[i - 3] == '<')
        ++qty[st[table - 1]];
    ++i;
  }
  sort(qty, qty + maxt + 1);
  for (int j = 1; j < maxt; ++j) printf("%d ", qty[j]);
  printf("%d\n", qty[maxt]);
  return 0;
}
