#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);
vector<int> answer;
vector<char> s;
const char* p;
void dfs() {
  int counter = 0;
  char c0 = 0;
  char c1 = 0;
  char c2 = 0;
  while (*p != 0) {
    c0 = c1;
    c1 = c2;
    c2 = *p++;
    if (c0 == '<' && c1 == 't' && c2 == 'a') {
      dfs();
    } else if (c0 == '/' && c1 == 't' && c2 == 'a') {
      break;
    } else if (c0 == '/' && c1 == 't' && c2 == 'd') {
      ++counter;
    }
  }
  answer.push_back(counter);
}
int main() {
  string line;
  while (getline(cin, line)) {
    s.insert(s.end(), (line).begin(), (line).end());
  }
  s.push_back(0);
  s.push_back(0);
  p = &s[0] + 1;
  dfs();
  sort((answer).begin(), (answer).end());
  for (int i = 0; i < (int)answer.size(); ++i) {
    cout << answer[i] << " ";
  }
  cout << endl;
}
