#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
int main() {
  istream &fin = cin;
  FILE *fpin = stdin;
  string s;
  while (1) {
    string t;
    fin >> t;
    if (fin.fail()) break;
    s += t;
  }
  int idx = -1;
  vector<int> vi;
  vector<int> res;
  for (int i = 0; i < (int)s.size() - 4; i++) {
    if (s.substr(i, 4) == "<tab") {
      idx++;
      vi.push_back(0);
    }
    if (s.substr(i, 4) == "<td>") {
      vi[idx]++;
    }
    if (s.substr(i, 4) == "</ta") {
      res.push_back(vi[idx]);
      vi.resize(idx);
      idx--;
    }
  }
  sort(res.begin(), res.end());
  for (int i = 0; i < (int)res.size(); i++) {
    cout << res[i] << " ";
  }
  cout << endl;
}
