#include <bits/stdc++.h>
using namespace std;
set<string> v;
bool cf(string s, string st) {
  int sl = 0;
  for (int i = 0; i < (s.size() < st.size() ? s.size() : st.size()); i++) {
    if (s[i] != st[i]) break;
    if (s[i] == '\\') sl++;
    if (sl == 2) break;
  }
  if (sl == 2) return 1;
  return 0;
}
void fold(string st) {
  int i;
  string temp = "";
  for (i = 0; i < st.size(); i++) {
    temp += st[i];
    if (st[i] == '\\') v.insert(temp);
  }
}
string s[104];
int main() {
  ios::sync_with_stdio(false);
  string t;
  int i = 0;
  while (cin >> t) {
    s[i++] = t;
  }
  int j, n = i;
  int mfile = 0;
  int mfol = 0;
  int an;
  for (i = 0; i < n; i++) {
    an = 0;
    v.clear();
    for (j = 0; j < n; j++)
      if (cf(s[i], s[j])) {
        an++;
        fold(s[j]);
      }
    mfile = (an > mfile ? an : mfile);
    mfol = (mfol > v.size() - 2 ? mfol : v.size() - 2);
  }
  cout << mfol << ' ' << mfile;
  return 0;
}
