#include <bits/stdc++.h>
using namespace std;
string in2;
int pos;
vector<int> out;
void rec();
void data() {
  assert(in2[pos] == 'D');
  pos++;
  while (1) {
    if (in2[pos] == 'A') {
      rec();
      continue;
    }
    break;
  }
  assert(in2[pos] == 'd');
  pos++;
}
int row() {
  assert(in2[pos] == 'R');
  pos++;
  int c = 0;
  while (1) {
    if (in2[pos] == 'D') {
      c++;
      data();
      continue;
    }
    break;
  }
  assert(in2[pos] == 'r');
  pos++;
  return c;
}
void rec() {
  assert(in2[pos] == 'A');
  pos++;
  int c = 0;
  while (1) {
    if (in2[pos] == 'R') {
      c += row();
      continue;
    }
    break;
  }
  assert(in2[pos] == 'a');
  pos++;
  out.push_back(c);
}
int main() {
  string in, p;
  while (cin >> p) in += p;
  in2 = "";
  pos = 0;
  while (pos < in.size()) {
    assert(in[pos] == '<');
    pos++;
    if (in[pos] == '/') {
      pos++;
      pos++;
      in2 += in[pos];
    } else {
      pos++;
      in2 += toupper(in[pos]);
    }
    while (in[pos] != '>') pos++;
    pos++;
  }
  pos = 0;
  out.clear();
  rec();
  sort(out.begin(), out.end());
  if (out.size()) printf("%d", out[0]);
  for (int i(1), _e(out.size() - 1); i <= _e; i++) {
    printf(" %d", out[i]);
  }
  printf("\n");
  return 0;
}
