#include <bits/stdc++.h>
using namespace std;
string s;
int i, j, n, m, k, p, c[10005], b[100005];
vector<int> g[10005];
vector<string> f[10005];
void dfs(int i, int d) {
  b[i] = g[i].size();
  for (int j = 0; j < g[i].size(); j++) {
    dfs(g[i][j], d + 1);
    b[i] += b[g[i][j]];
    c[i] += c[g[i][j]];
  }
  if (d > 1) {
    k = max(b[i], k);
    p = max(c[i], p);
  }
}
int main() {
  while (cin >> s) {
    n = s.size();
    j = 0;
    for (i = 0; i < n; i = k + 1) {
      for (k = i; k < n; k++)
        if (s[k] == '\\') break;
      if (k < n) {
        string t = s.substr(i, k - i);
        for (p = 0; p < f[j].size(); p++)
          if (t == f[j][p]) break;
        if (p == f[j].size()) {
          g[j].push_back(++m);
          f[j].push_back(t);
          j = m;
        } else
          j = g[j][p];
      } else
        c[j]++;
    }
  }
  k = p = 0;
  dfs(0, 0);
  cout << k << ' ' << p;
  return 0;
}
