#include <bits/stdc++.h>
using namespace std;
template <class T>
void pv(T a, T b) {
  for (T i = a; i != b; ++i) cerr << *i << ' ';
  cout << endl;
}
vector<string> split(string s) {
  for (int i = 0; i < (int)(((int)((s).size()))); ++i)
    if (s[i] == '\\') s[i] = ' ';
  vector<string> v;
  stringstream ss(s);
  string token;
  while (ss >> token) v.push_back(token);
  return v;
}
pair<int, int> f(vector<string> vs) {
  sort((vs).begin(), (vs).end());
  vs.erase(unique((vs).begin(), (vs).end()), vs.end());
  pair<int, int> res;
  for (int i = 0; i < (int)(((int)((vs).size()))); ++i) {
    if (vs[i][vs[i].size() - 1] == '\\')
      res.first++;
    else
      res.second++;
  }
  return res;
}
int main() {
  map<string, vector<string> > tree;
  int best_sub = 0;
  int best_file = 0;
  string path;
  while (cin >> path) {
    vector<string> v = split(path);
    string key = v[0] + v[1];
    string val;
    for (int i = 2; i < (int)v.size(); i++) {
      val += v[i];
      if (i + 1 != v.size()) val += "\\";
      tree[key].push_back(val);
    }
    for (map<string, vector<string> >::iterator it = tree.begin();
         it != tree.end(); ++it) {
      pair<int, int> t = f(it->second);
      best_sub = max(best_sub, t.first);
      best_file = max(best_file, t.second);
    }
  }
  cout << best_sub << ' ' << best_file << endl;
  return 0;
}
