#include <bits/stdc++.h>
using namespace std;
vector<int> v;
stack<int> stk;
string str;
char ss[5005];
int cnt;
void table_st(int indx) {
  if (str[indx] != '>') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'e') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'l') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'b') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'a') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 't') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != '<') return;
  if (cnt) stk.push(cnt);
  cnt = 0;
  stk.push(INT_MAX);
  return;
}
void table_end(int indx) {
  if (str[indx] != '>') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'e') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'l') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'b') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'a') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 't') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != '/') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != '<') return;
  if (cnt) stk.push(cnt);
  cnt = 0;
  stk.push(INT_MIN);
  return;
}
void td_st(int indx) {
  if (str[indx] != '>') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 'd') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != 't') return;
  indx--;
  if (indx < 0) return;
  if (str[indx] != '<') return;
  cnt++;
  return;
}
void solve() {
  int c = 0;
  stk.pop();
  while (stk.top() != INT_MAX) {
    if (stk.top() == INT_MIN) solve();
    c += stk.top();
    stk.pop();
  }
  stk.pop();
  v.push_back(c);
  return;
}
int main() {
  while (scanf("%s", ss) == 1) {
    str += (string)ss;
  }
  for (int i = 0; str[i]; i++) {
    if (str[i] == '>') {
      table_st(i);
      table_end(i);
      td_st(i);
    }
  }
  while (!stk.empty()) solve();
  sort(v.begin(), v.end());
  for (int i = 0; i < (int)v.size(); i++) {
    if (i) printf(" ");
    printf("%d", v[i]);
  }
  puts("");
  return 0;
}
