#include <bits/stdc++.h>
using namespace std;
map<string, set<string> > subfs;
map<string, int> files;
void Find(string s, char c, int &i) {
  while (i >= 0 && s[--i] != c)
    ;
}
void doit(string s) {
  int subf = 0, i = s.size() - 1;
  vector<string> vec;
  Find(s, '\\', i);
  files[s.substr(0, i)]++;
  vec.push_back(s.substr(0, i));
  while (true) {
    Find(s, '\\', i);
    if (i > 2) {
      vec.push_back(s.substr(0, i));
      for (int j = 0; j < vec.size() - 1; j++)
        subfs[s.substr(0, i)].insert(vec[j]);
      files[s.substr(0, i)]++;
    } else
      break;
  }
}
int main() {
  string s;
  while (getline(cin, s)) doit(s);
  int anss = 0, ansf = 0;
  for (map<string, set<string> >::iterator it1 = subfs.begin();
       it1 != subfs.end(); it1++)
    if (it1->second.size() > anss) anss = it1->second.size();
  for (map<string, int>::iterator it2 = files.begin(); it2 != files.end();
       it2++)
    if (it2->second > ansf) ansf = it2->second;
  cout << anss << ' ' << ansf << '\n';
  return 0;
}
