#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:136777216")
using namespace std;
int bits(int x) { return x == 0 ? 0 : 1 + bits(x & (x - 1)); }
const double PI = acos(-1.0);
const double eps = 1e-12;
const int INF = 1000000000;
string nextString() {
  char buf[300000];
  scanf("%s", buf);
  return buf;
}
vector<string> in, name;
string get_name(string s) {
  string t;
  int ind = 0;
  while (s[ind] != '\\') {
    t += s[ind];
    ind++;
  }
  t += '\\';
  ind++;
  while (s[ind] != '\\') {
    t += s[ind];
    ind++;
  }
  return t;
}
int main() {
  ios_base::sync_with_stdio(0);
  int ans_f = -1, ans_p = -1;
  string s;
  while (getline(cin, s)) {
    in.push_back(s);
    name.push_back(get_name(s));
  }
  for (int(i) = 0; (i) < ((int)(in).size()); (i)++) {
    string t = name[i];
    set<pair<string, string> > p, f;
    for (int(j) = (i); (j) < ((int)(in).size()); (j)++) {
      if (name[j] == t) {
        int ind = (int)(name[j]).size() + 1;
        string prev = name[j] + '\\';
        while (1) {
          string cur = "";
          while (ind != (int)(in[j]).size() && in[j][ind] != '\\') {
            cur += in[j][ind];
            ind++;
          }
          if (ind == (int)(in[j]).size()) {
            if (f.find(make_pair(cur, prev)) == f.end())
              f.insert(make_pair(cur, prev));
            break;
          } else if (p.find(make_pair(cur, prev)) == p.end())
            p.insert(make_pair(cur, prev));
          ind++;
          prev += cur + '\\';
        }
      }
    }
    ans_f = max(ans_f, (int)(f).size());
    ans_p = max(ans_p, (int)(p).size());
  }
  cout << ans_p << " " << ans_f << "\n";
  return 0;
}
