#include <bits/stdc++.h>
using namespace std;
const long long SZ = 500007;
const long long mod = 998244353;
long long i, j, k, n, m, t, first, second, a[SZ], b[SZ];
long long kop(vector<string> s) {
  sort(s.begin(), s.end());
  long long n = s.size(), ans = 0;
  vector<string> st1, st2, st3;
  set<string> stt;
  for (long long i = 0; i < n; i++) {
    long long m = s[i].size();
    string ss;
    long long p = 0;
    for (long long j = 0; j < m; j++) {
      ss += s[i][j];
      p = j + 1;
      if (s[i][j] == 92) break;
    }
    string st = s[i].substr(p);
    if (st.size() != 0) {
      st1.push_back(ss);
      st2.push_back(st);
    } else {
      stt.insert(ss);
    }
  }
  n = st1.size();
  for (long long i = 0; i < n; i++) {
    if (i == 0)
      st3.push_back(st2[i]);
    else {
      if (st1[i - 1] == st1[i]) {
        st3.push_back(st2[i]);
      } else {
        stt.insert(st1[i - 1]);
        ans += kop(st3);
        st3.clear();
        st3.push_back(st2[i]);
      }
    }
  }
  if (st3.size() > 0) {
    stt.insert(st1[n - 1]);
    ans += kop(st3);
  }
  ans += stt.size();
  st1.clear();
  st2.clear();
  st3.clear();
  stt.clear();
  return ans;
}
long long vis[107];
int main() {
  vector<string> v, st1, st2, st3;
  string s;
  while (cin >> s) {
    v.push_back(s);
  }
  n = v.size();
  sort(v.begin(), v.end());
  map<string, long long> mp;
  for (long long i = 0; i < n; i++) {
    long long m = v[i].size();
    first = 0;
    s = "";
    long long p1, p2 = 0;
    for (long long j = 0; j < m; j++) {
      if (v[i][j] == 92) first++;
      s += v[i][j];
      p1 = j + 1;
      if (first == 2) break;
    }
    for (j = m - 1; j >= 0; j--) {
      p2 = j + 1;
      if (v[i][j] == 92) break;
    }
    mp[s]++;
    string s1 = v[i].substr(0, p1);
    string s2 = "";
    for (j = p1; j < p2; j++) s2 += v[i][j];
    if (s2.size() > 0) {
      st1.push_back(s1);
      st2.push_back(s2);
    }
  }
  long long mx1 = 0, mx2 = 0;
  for (auto first : mp) mx2 = max(mx2, first.second);
  n = st1.size();
  for (long long i = 0; i < n; i++) {
    if (i == 0)
      st3.push_back(st2[i]);
    else {
      if (st1[i - 1] == st1[i]) {
        st3.push_back(st2[i]);
      } else {
        mx1 = max(mx1, kop(st3));
        st3.clear();
        st3.push_back(st2[i]);
      }
    }
  }
  if (st3.size() > 0) mx1 = max(mx1, kop(st3));
  cout << mx1 << " " << mx2 << "\n";
  ;
  return 0;
}
