#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
string str, s;
int n, data[maxn];
vector<int> V;
void input() {
  while (cin >> s) str += s;
}
void solve() {
  int len = str.length();
  for (int i = 0; i < len; i++) {
    if (str[i] == '<' && str[i + 1] == 't' && str[i + 2] == 'a') n++;
    if (str[i] == '<' && str[i + 1] == 't' && str[i + 2] == 'd') data[n]++;
    if (str[i] == '<' && str[i + 1] == '/' && str[i + 2] == 't' &&
        str[i + 3] == 'a') {
      V.push_back(data[n]);
      data[n--] = 0;
    }
  }
  sort(V.begin(), V.end());
  for (int i = 0; i < (int)V.size(); i++) printf("%d ", V[i]);
  printf("\n");
}
int main() {
  input();
  solve();
  return 0;
}
