#include <bits/stdc++.h>
using namespace std;
map<string, int> o, i;
int main() {
  string str, s;
  int mi = 0, mo = 0;
  while (cin >> str) {
    int F = 0;
    while (1) {
      int x = str.find_last_of('\\');
      if (x == 2) break;
      str = str.substr(0, x);
      int f = i[str];
      o[str] += F;
      i[str]++;
      mo = max(mo, o[str]);
      mi = max(mi, i[str]);
      if (!f) F++;
    }
  }
  cout << mo << ' ' << mi;
  return 0;
}
