#include <bits/stdc++.h>
using namespace std;
string s, s1;
stack<int> S;
multiset<int> tb;
int main() {
  s = "";
  while (cin >> s1) s += s1;
  int i, l = s.length(), now;
  for (i = 0; i < l; i++) {
    if (s[i] == '<') {
      i++;
      if (s[i] == 't') {
        i++;
        if (s[i] == 'a')
          S.push(0);
        else if (s[i] == 'd')
          S.top()++;
      } else {
        i += 2;
        if (s[i] == 'a') now = S.top(), S.pop(), tb.insert(now);
      }
    }
  }
  for (auto it = tb.begin(); it != tb.end(); it++) printf("%d ", *it);
  puts("");
  return 0;
}
