#include <bits/stdc++.h>
using namespace std;
int main() {
  string st, in;
  while (cin >> in) {
    st += in;
  }
  vector<int> v;
  int cur = 0;
  while (true) {
    int cur = st.find("<table>", 0);
    if (cur == -1) break;
    while (true) {
      int head = st.find("<table>", cur);
      int nextHead = st.find("<table>", head + 1);
      if (nextHead == -1) {
        int tail = st.find("</table>", cur);
        v.push_back(count(st.begin() + head, st.begin() + tail, 'd') / 2);
        for (int i = head; i <= tail; ++i) {
          st[i] = ' ';
        }
        break;
      }
      cur = nextHead;
    }
  }
  sort((v).begin(), (v).end());
  for (int i = 0; i < ((int)(v).size()); ++i) {
    if (i) cout << " ";
    cout << v[i];
  }
  cout << endl;
}
