#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
string s, curs;
int main() {
  while (cin >> curs) {
    s += curs;
  }
  vector<int> res;
  vector<int> st;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '<') {
      if (s[i + 2] == 'a') {
        st.push_back(0);
      }
      if (s[i + 3] == 'a') {
        res.push_back(st.back());
        st.pop_back();
      }
      if (s[i + 2] == 'd') {
        ++st[st.size() - 1];
      }
      while (s[i] != '>') ++i;
    }
  }
  sort(res.begin(), res.end());
  for (int i = 0; i < res.size(); ++i) printf("%d ", res[i]);
  return 0;
};
