#include <bits/stdc++.h>
using namespace std;
string s;
struct Node {
  string s;
  int file, fold;
  vector<int> child;
} node[101010];
int tot;
void ins() {
  int c = 0, p = 0;
  int len = s.length();
  while (p < len) {
    int d = p;
    while (d < len && s[d] != '.' && !isalpha(s[d]) && !isdigit(s[d])) d++;
    p = d;
    while (d < len && (isalpha(s[d]) || isdigit(s[d]) || s[d] == '.')) d++;
    string x = s.substr(p, d - p);
    p = d;
    if (p == len) {
      node[c].file++;
      continue;
    }
    bool flag = 0;
    for (int i = 0; i < (int)node[c].child.size(); i++) {
      int id = node[c].child[i];
      if (node[id].s == x) {
        flag = 1;
        c = id;
        break;
      }
    }
    if (!flag) {
      node[c].child.push_back(tot);
      node[tot].s = x;
      node[tot].fold++;
      c = tot;
      tot++;
    }
  }
}
void dfs(int u) {
  for (int i = 0; i < (int)node[u].child.size(); i++) {
    int id = node[u].child[i];
    dfs(id);
    node[u].file += node[id].file;
    node[u].fold += node[id].fold;
  }
}
int main() {
  tot++;
  while (cin >> s) {
    ins();
  }
  dfs(0);
  int mx1 = 0, mx2 = 0;
  for (int i = 0; i < (int)node[0].child.size(); i++) {
    int id = node[0].child[i];
    for (int j = 0; j < (int)node[id].child.size(); j++) {
      mx1 = max(mx1, node[node[id].child[j]].fold - 1);
      mx2 = max(mx2, node[node[id].child[j]].file);
    }
  }
  printf("%d %d\n", mx1, mx2);
  return 0;
}
