#include <bits/stdc++.h>
using namespace std;
string str;
int ss;
int par[10001];
int ans[2][10001];
int root(int x) {
  if (par[x] != x) par[x] = root(par[x]);
  return par[x];
}
map<string, int> m;
int main() {
  while (getline(cin, str)) {
    char ty = str[0];
    int k = 2;
    int z = 0;
    int p = 0;
    string tt = "";
    tt += ty;
    tt += '\"';
    while (k < str.size()) {
      tt += '\\';
      string t = "";
      k++;
      while (k < str.size() && str[k] != '\\') t += str[k], k++;
      tt += t;
      z++;
      if (k < str.size()) {
        if (!m.count(tt)) {
          m[tt] = ++ss;
          par[m[tt]] = m[tt];
        }
        if (z > 1) {
          int xx = root(m[tt]);
          int yy = root(p);
          if (xx != yy) {
            par[xx] = yy;
            ans[0][yy]++;
          }
        }
        p = m[tt];
      } else {
        ans[1][root(p)]++;
      }
    }
  }
  int mx1 = 0, mx2 = 0;
  for (map<string, int>::iterator it = m.begin(); it != m.end(); it++) {
    mx1 = max(mx1, ans[0][it->second]);
    mx2 = max(mx2, ans[1][it->second]);
  }
  cout << mx1 << " " << mx2;
  return 0;
}
