#include <bits/stdc++.h>
using namespace std;
const int N = 107;
string s[N][N], ss[N];
int cnt = 0, k[N], ans1, ans2;
map<string, int> mp;
int main() {
  while (cin >> ss[++cnt])
    ;
  --cnt;
  for (int i = 1; i <= cnt; i++) {
    s[i][0] += ss[i][0];
    int l = 2, len = ss[i].length();
    while (l < len) {
      if (ss[i][l] == '\\')
        k[i]++;
      else
        s[i][k[i]] += ss[i][l];
      l++;
    }
  }
  for (int i = 1; i <= cnt; i++) {
    int now = 1;
    for (int j = i + 1; j <= cnt; j++)
      if (s[i][0] == s[j][0] && s[i][1] == s[j][1]) now++;
    ans2 = max(ans2, now);
  }
  for (int i = 1; i <= cnt; i++) {
    if (!mp.count(s[i][0] + s[i][1])) {
      mp[s[i][0] + s[i][1]] += k[i] - 2;
      ans1 = max(ans1, mp[s[i][0] + s[i][1]]);
      continue;
    }
    int now = 0;
    for (int j = 1; j < i; j++) {
      if (s[i][0] != s[j][0] || s[i][1] != s[j][1]) continue;
      int n = 0;
      for (int o = 2; o < k[i] && o < k[j]; o++)
        if (s[i][o] == s[j][o])
          n++;
        else
          break;
      now = max(now, n);
    }
    if (k[i] - 2 - now > 0) mp[s[i][0] + s[i][1]] += k[i] - 2 - now;
    ans1 = max(ans1, mp[s[i][0] + s[i][1]]);
  }
  cout << ans1 << " " << ans2;
}
