#include <bits/stdc++.h>
using namespace std;
long long a, b, c[1234567], d[1234567], c1[1234][1234], e, n, j, i, l, r, x, y,
    k, ans, sum;
bool used[1234567];
long long T;
char ch[1234][1234];
bool vis[1234][1234];
vector<long long> v[1234567], v1;
string s, s1[1234567];
pair<long long, long long> p[1234567];
string S;
void dfs() {
  long long cnt = 0;
  while (i < S.size() - 6) {
    if (S[i] == '/' && S[i + 1] == 't' && S[i + 2] == 'a') {
      i += 7;
      break;
    }
    if (S[i] == 't' && S[i + 1] == 'a') {
      i += 6;
      dfs();
    }
    if (S[i] == '/' && S[i + 1] == 't' && S[i + 2] == 'd') {
      cnt++;
    }
    i++;
  }
  v1.push_back(cnt);
  return;
}
int main() {
  while (cin >> s) {
    S += s;
  }
  dfs();
  sort(v1.begin(), v1.end());
  for (i = 1; i < v1.size(); i++) cout << v1[i] << " ";
}
