#include <bits/stdc++.h>
using namespace std;
string obs;
string stroka;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  while (cin >> stroka) {
    obs += stroka;
  }
  vector<long long> ans;
  stack<long long> tmp;
  long long cnt = 0;
  for (long long i = 0; i < (long long)obs.size(); i++) {
    if (obs[i] == '<' && i + 1 < (long long)obs.size() &&
        i + 2 < (long long)obs.size() && i + 3 < (long long)obs.size() &&
        i + 4 < (long long)obs.size() && i + 5 < (long long)obs.size() &&
        obs[i + 1] == 't' && obs[i + 2] == 'a' && obs[i + 3] == 'b' &&
        obs[i + 4] == 'l' && obs[i + 5] == 'e') {
      tmp.push(cnt);
      cnt = 0;
    } else if (obs[i] == '<' && i + 1 < (long long)obs.size() &&
               i + 2 < (long long)obs.size() && obs[i + 1] == 't' &&
               obs[i + 2] == 'd')
      cnt++;
    else if (obs[i] == '/' && i + 1 < (long long)obs.size() &&
             i + 2 < (long long)obs.size() && i + 3 < (long long)obs.size() &&
             i + 4 < (long long)obs.size() && i + 5 < (long long)obs.size() &&
             obs[i + 1] == 't' && obs[i + 2] == 'a' && obs[i + 3] == 'b' &&
             obs[i + 4] == 'l' && obs[i + 5] == 'e') {
      ans.push_back(cnt);
      cnt = tmp.top();
      tmp.pop();
    }
  }
  sort((ans).begin(), (ans).end());
  for (long long i = 0; i < (long long)ans.size(); i++) cout << ans[i] << " ";
  cout << "\n";
  ;
  return 0;
}
