#include <bits/stdc++.h>
using namespace std;
struct iii {
  int a, b, c;
  iii() {}
  iii(int a, int b, int c) : a(a), b(b), c(c) {}
  bool operator<(const iii& e) const {
    return a < e.a || a == e.a && (b < e.b || b == e.b && c < e.c);
  }
};
template <typename T>
T sq(const T& x) {
  return x * x;
}
template <typename T>
void minl(T& a, const T& b) {
  if (a > b) a = b;
}
template <typename T>
void maxl(T& a, const T& b) {
  if (a < b) a = b;
}
template <typename T>
void usort(vector<T>& a) {
  sort((a).begin(), (a).end());
  a.erase(unique((a).begin(), (a).end()), a.end());
}
template <typename T>
int index(const vector<T>& a, const T& x) {
  return lower_bound((a).begin(), (a).end(), x) - a.begin();
}
pair<int, int> operator+(const pair<int, int>& a, const pair<int, int>& b) {
  return pair<int, int>(a.first + b.first, a.second + b.second);
}
pair<int, int> operator-(const pair<int, int>& a, const pair<int, int>& b) {
  return pair<int, int>(a.first - b.first, a.second - b.second);
}
long long cross(const pair<int, int>& a, const pair<int, int>& b) {
  return (long long)a.first * b.second - (long long)b.first * a.second;
}
int what() {
  int ret = 0;
  int f = 1;
  while (1) {
    char c = getchar();
    if (c == EOF) return 0;
    if (c != '/' && c != 'a' && c != 'r' && c != 'd') continue;
    if (c == '/') {
      f = -1;
      continue;
    }
    if (c == 'a') ret = 1;
    if (c == 'r') ret = 2;
    if (c == 'd') ret = 3;
    while (getchar() != '>')
      ;
    break;
  }
  return ret * f;
}
void york() {
  int tt[2000];
  int top = 0;
  vector<int> ans;
  while (1) {
    int cur = what();
    if (!cur) break;
    if (cur == 1) {
      top++;
      tt[top] = 0;
    }
    if (cur == 3) {
      tt[top]++;
    }
    if (cur == -1) {
      ans.push_back(tt[top]);
      top--;
    }
  }
  sort((ans).begin(), (ans).end());
  for (int i = 0; i < ((int)(ans).size()); i++) {
    if (i) putchar(32);
    printf("%d", ans[i]);
  }
  putchar(10);
}
int main() {
  york();
  return 0;
}
