#include <bits/stdc++.h>
using namespace std;
map<string, pair<int, int> > Mp;
int main() {
  string s[1000], S;
  int size = 0;
  while (cin >> S) s[size++] = S;
  int ans1 = 1, ans2 = 0;
  for (int i = 0; i < size; i++) {
    string a;
    vector<string> ss;
    for (int j = 0; j < s[i].size(); j++) {
      a += s[i][j];
      if (j > 2 && s[i][j] == '\\') ss.push_back(a);
    }
    for (int i = 0; i < ss.size(); i++) {
      if (Mp.find(ss[i]) == Mp.end()) {
        Mp[ss[i]] = make_pair(1, 0);
        for (int j = 0; j < i; j++) {
          Mp[ss[j]].second++;
          ans2 = max(ans2, Mp[ss[j]].second);
        }
      } else
        Mp[ss[i]].first++;
      ans1 = max(Mp[ss[i]].first, ans1);
    }
  }
  cout << ans2 << " " << ans1 << endl;
}
