#include <bits/stdc++.h>
using namespace std;
map<vector<string>, set<string> > M[5];
int dir(int i, vector<string> v) { return M[i][v].size(); }
pair<int, int> solve(int i, vector<string> v) {
  int a = 0;
  int b = 0;
  set<string> u = M[i][v];
  for (set<string>::iterator it = u.begin(); it != u.end(); it++) {
    vector<string> nv = v;
    nv.push_back(*it);
    if (dir(i, nv)) {
      pair<int, int> p = solve(i, nv);
      a += 1 + p.first;
      b += p.second;
    } else
      b++;
  }
  return pair<int, int>(a, b);
}
int main() {
  string s;
  while (cin >> s) {
    int i = s[0] - 'C';
    s[0] = ' ';
    for (int j = 0; j < s.length(); j++)
      if (s[j] == '\\' || s[j] == ':') s[j] = ' ';
    stringstream ss(s);
    vector<string> v;
    string t;
    while (ss >> t) {
      M[i][v].insert(t);
      v.push_back(t);
    }
  }
  int mxfolder = 0;
  int mxfile = 0;
  for (int i = 0; i < 5; i++) {
    set<string> v = M[i][vector<string>()];
    for (set<string>::iterator it = v.begin(); it != v.end(); it++) {
      vector<string> nv;
      nv.push_back(*it);
      pair<int, int> p = solve(i, nv);
      mxfolder = max(mxfolder, p.first);
      mxfile = max(mxfile, p.second);
    }
  }
  cout << mxfolder << ' ' << mxfile << endl;
}
