#include <bits/stdc++.h>
using namespace std;
map<string, pair<int, set<string> > > mp;
int main() {
  string s;
  while (cin >> s) {
    string s1;
    int uk = 1;
    s1 += s[0];
    while (s[uk] != char(92) || s[uk - 1] == ':') {
      s1 += s[uk];
      uk++;
    }
    uk++;
    string s2 = s1 + s[uk - 1];
    for (; uk < s.size(); uk++) {
      if (s[uk] == char(92)) {
        s2 += s[uk];
        mp[s1].second.insert(s2);
      } else {
        s2 += s[uk];
      }
    }
    mp[s1].first++;
  }
  int ans1 = 0, ans2 = 0;
  for (map<string, pair<int, set<string> > >::iterator it = mp.begin();
       it != mp.end(); ++it) {
    ans1 = max(ans1, (*it).second.first);
    ans2 = max(ans2, int((*it).second.second.size()));
  }
  cout << ans2 << " " << ans1;
  return 0;
}
