#include <bits/stdc++.h>
using namespace std;
int x = 8;
string s, pal;
vector<int> ans;
void solve() {
  int aux = 0;
  bool gud = false;
  while (!gud)
    if (pal[x] == '/') {
      if (pal[x + 2] == 'd' || pal[x + 2] == 'r') {
        x += 5;
      } else
        x += 8, gud = true;
    } else if (pal[x + 1] == 'd' || pal[x + 1] == 'r') {
      if (pal[x + 1] == 'd') aux++;
      x += 4;
    } else
      x += 7, solve();
  ans.push_back(aux);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  while (cin >> s) pal += s;
  solve();
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
}
