#include <bits/stdc++.h>
using namespace std;
map<string, pair<int, int> > m;
const pair<int, int> FILENULL(0, 0);
int main() {
  string str;
  m.clear();
  while (cin >> str) {
    int folder = 0, file = 1, pos;
    while ((pos = str.find_last_of('\\')) != 2) {
      str = str.substr(0, pos);
      bool flag = (m[str] == FILENULL);
      m[str].first += folder;
      m[str].second += file;
      if (flag) folder++;
    }
  }
  int maxFolder = 0, maxFile = 0;
  for (map<string, pair<int, int> >::iterator it = m.begin(); it != m.end();
       it++) {
    maxFolder = maxFolder > (*it).second.first ? maxFolder : (*it).second.first;
    maxFile = maxFile > (*it).second.second ? maxFile : (*it).second.second;
  }
  cout << maxFolder << ' ' << maxFile << endl;
}
