#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167772160")
using namespace std;
int p, i, j, res, d, k, dd, rr;
string s, w[101], s1, s2, w1, w2;
int main() {
  p = 0;
  while (getline(cin, s)) {
    w[p] = s;
    p++;
  }
  sort(w, w + p);
  res = 0;
  rr = 0;
  d = 0;
  dd = 0;
  for (i = 0; i < p; i++) {
    k = 0;
    s2 = "";
    for (j = 0; j < w[i].length(); j++)
      if (w[i][j] == 92 && k == 1)
        break;
      else if (w[i][j] == 92) {
        k++;
        s2 += w[i][j];
      } else
        s2 += w[i][j];
    if (i == 0 || s2 == s1)
      d++;
    else
      d = 1;
    if (d > res) res = d;
    s1 = s2;
  }
  for (i = 0; i < p; i++) {
    k = 0;
    s2 = "";
    for (j = 0; j < w[i].length(); j++)
      if (w[i][j] == 92 && k == 1)
        break;
      else if (w[i][j] == 92) {
        k++;
        s2 += w[i][j];
      } else
        s2 += w[i][j];
    if (i > 0 && s2 == s1)
      d = 1;
    else
      d = 0;
    s1 = s2;
    if (d == 0) {
      dd = 0;
      for (j = 0; j < w[i].length(); j++)
        if (w[i][j] == 92) dd++;
      dd -= 2;
      if (dd > rr) rr = dd;
    } else {
      j = 0;
      while (j < w[i - 1].length() && j < w[i].length() &&
             w[i - 1][j] == w[i][j])
        j++;
      for (int l = j; l < w[i].length(); l++)
        if (w[i][l] == 92) dd++;
    }
    if (dd > rr) rr = dd;
  }
  cout << rr << " " << res << endl;
}
