#include <bits/stdc++.h>
using namespace std;
const int BUFSIZE = 8192;
const int MAX_D = 5;
enum { T_ROOT, T_FLDR, T_FILE };
struct Node {
  int id, t, cn, c0, c1;
  Node *prt;
  vector<Node *> cs;
  Node() : cn(0), c0(0), c1(0), cs() {}
  void print() {
    printf("%d", id);
    if (t != T_FILE) {
      putchar('(');
      for (int i = 0; i < cs.size(); i++) {
        if (i) putchar(',');
        cs[i]->print();
      }
      putchar(')');
    }
  }
};
typedef vector<Node *> vnpt;
typedef queue<Node *> qnpt;
Node buf[BUFSIZE], *bpt = buf;
char s[128];
Node drvs[MAX_D];
map<string, int> idmap;
int allocid(string &s, int &gn) {
  map<string, int>::iterator mit = idmap.find(s);
  if (mit != idmap.end()) return mit->second;
  return (idmap[s] = gn++);
}
int main() {
  for (int i = 0; i < MAX_D; i++) drvs[i].id = -1, drvs[i].t = T_ROOT;
  int fn = 0;
  qnpt q;
  while (scanf("%s", s) > 0) {
    Node *prt = drvs + (s[0] - 'C');
    for (char *cpt = s + 2; *cpt;) {
      cpt++;
      char *pcpt = cpt;
      while (*cpt != '\0' && *cpt != '\\') cpt++;
      string w(pcpt, cpt);
      int fid = allocid(w, fn);
      vnpt &pcs = prt->cs;
      Node *npt = NULL;
      for (vnpt::iterator vit = pcs.begin(); vit != pcs.end(); vit++)
        if (fid == (*vit)->id) {
          npt = *vit;
          break;
        }
      if (npt == NULL) {
        npt = bpt++;
        npt->id = fid;
        npt->t = (*cpt == '\\') ? T_FLDR : T_FILE;
        npt->prt = prt;
        prt->cn++;
        prt->cs.push_back(npt);
      }
      prt = npt;
    }
    q.push(prt);
  }
  int maxc0 = 0, maxc1 = 0;
  while (!q.empty()) {
    Node *u = q.front();
    q.pop();
    Node *up = u->prt;
    if (up->t == T_ROOT) {
      if (maxc0 < u->c0) maxc0 = u->c0;
      if (maxc1 < u->c1) maxc1 = u->c1;
    } else {
      if (u->t == T_FILE)
        up->c1++;
      else
        up->c0 += u->c0 + 1, up->c1 += u->c1;
      if (--(up->cn) == 0) q.push(up);
    }
  }
  printf("%d %d\n", maxc0, maxc1);
  if (false) {
    for (int d = 0; d < MAX_D; d++)
      if (!drvs[d].cs.empty()) {
        drvs[d].print();
        putchar('\n');
      }
  }
  return 0;
}
