#include <bits/stdc++.h>
using namespace std;
char s[210];
map<string, int> cn, cn2;
map<string, char> us;
int main() {
  int a1 = 0, a2 = 0;
  while (scanf("%s", s) != EOF) {
    int l = strlen(s);
    bool f = 1;
    string sp;
    int d = 0;
    while (1) {
      while (s[l - 1] != '\\') l--;
      l--;
      if (l == 2) break;
      s[l] = 0;
      string ss = s;
      if (!f) {
        if (us[sp] == 0) d++;
        cn[ss] += d;
        a1 = max(a1, cn[ss]);
        us[sp] = 1;
      }
      cn2[ss]++;
      a2 = max(a2, cn2[ss]);
      f = 0;
      sp = ss;
    }
  }
  printf("%d %d\n", a1, a2);
  return 0;
}
