#include <bits/stdc++.h>
using namespace std;
string s, t;
int res1, res2;
map<string, int> M, N;
int main() {
  std::ios::sync_with_stdio(false);
  while (cin >> t) {
    s = t;
    int F = 0;
    while (1) {
      int x = s.find_last_of('\\');
      if (x == 2) break;
      s = s.substr(0, x);
      int f = N[s];
      M[s] += F;
      N[s]++;
      res1 = max(res1, M[s]);
      res2 = max(res2, N[s]);
      if (!f) F++;
    }
  }
  cout << res1 << ' ' << res2 << endl;
}
