#include <bits/stdc++.h>
using namespace std;
vector<string> a;
map<string, int> mp;
int b[10000], c[10000];
int ans1 = 0, ans2 = 0;
int main() {
  string s;
  int last = 0, la = 0, be = 0;
  char h;
  int x = 0, aa = 0;
  while (cin.get(h)) {
    if (h == ':') {
      cin >> h;
      continue;
    }
    if (h == 92) {
      a.push_back(s);
      if (mp.find(s) == mp.end()) {
        mp[s] = x;
        for (int i = 0; i < a.size() - 1; i++) b[mp[a[i]]]++;
        x++;
      }
    }
    if (h == '\n') {
      for (int i = 0; i < a.size(); i++) {
        c[mp[a[i]]]++;
        ;
      }
      a.clear();
      s.clear();
      continue;
    }
    s = s + h;
  }
  for (int i = 0; i < mp.size(); i++) {
    ans1 = max(b[i], ans1);
    ans2 = max(c[i], ans2);
  }
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
