#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int num = 0;
  char c = getchar();
  if (c == '-') return -read();
  while (c >= '0' && c <= '9') {
    num = (num << 3) + (num << 1) + c - '0';
    c = getchar();
  }
  return num;
}
inline long long READ() {
  long long num = 0;
  char c = getchar();
  if (c == '-') return -READ();
  while (c >= '0' && c <= '9') {
    num = (num << 3) + (num << 1) + c - '0';
    c = getchar();
  }
  return num;
}
map<string, int> fo, fi;
string s;
int mxfo, mxfi;
int main() {
  while (cin >> s) {
    int cnt = 0;
    for (int i = ((int)(s).size()); i > 3; i--)
      if (s[i] == '\\') {
        fo[s.substr(0, i)] += cnt;
        if (!fi[s.substr(0, i)]) cnt++;
        fi[s.substr(0, i)]++;
      }
  }
  for (__typeof(fo.begin()) it = fo.begin(); it != fo.end(); it++)
    mxfo = max(mxfo, it->second);
  for (__typeof(fi.begin()) it = fi.begin(); it != fi.end(); it++)
    mxfi = max(mxfi, it->second);
  cout << mxfo << ' ' << mxfi << endl;
}
