#include <bits/stdc++.h>
using namespace std;
map<string, int> m[5][2];
int main() {
  string a;
  int max1 = 0, max2 = 0;
  for (; cin >> a;) {
    int x = a[0] - 'C';
    int i;
    int t = 0;
    int c = 0;
    for (i = a.length(); i >= 3; i--) {
      if (a[i] == '\\') {
        m[x][0][a.substr(0, i)] += c;
        c -= (m[x][1][a.substr(0, i)] != 0);
        t = 1;
        m[x][1][a.substr(0, i)]++;
        max1 = max(max1, m[x][0][a.substr(0, i)]);
        max2 = max(max2, m[x][1][a.substr(0, i)]);
        c++;
      }
    }
  }
  printf("%d %d\n", max1, max2);
  return 0;
}
