#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1007;
int i, j, k, n, m, t, x, y, l, ans;
int bkt[MAXN];
string s, ts;
int countTd(int l, int r) {
  int i, j, k, t, cnt;
  cnt = 0;
  t = s.find("<td>", l);
  while (t > -1 && t < r) {
    cnt++;
    t = s.find("<td>", t + 1);
  }
  return cnt;
}
int dfs(int k) {
  int i, j, t, tl, tr, cnt;
  cnt = 0;
  t = k;
  tl = s.find("<table>", t + 1);
  tr = s.find("</table>", t + 1);
  while (tl > -1) {
    if (tl < tr) {
      cnt += countTd(t, tl);
      t = dfs(tl);
    } else {
      cnt += countTd(t, tr);
      bkt[cnt]++;
      return tr;
    }
    tl = s.find("<table>", t + 1);
    tr = s.find("</table>", t + 1);
  }
  cnt += countTd(t, tr);
  bkt[cnt]++;
  return tr;
}
int main() {
  s = "";
  while (cin >> ts) {
    s += ts;
  }
  n = s.length();
  ans = 0;
  t = s.find("<table>");
  if (t > -1) {
    dfs(t);
  }
  for (i = 1; i < MAXN; i++) {
    while (bkt[i]--) {
      cout << i << " ";
    }
  }
  cout << endl;
  return 0;
}
