#include <bits/stdc++.h>
using namespace std;
struct Tree {
  string name;
  vector<Tree> sub;
  Tree() {}
  Tree(string name) { this->name = name; }
  void makeTree(vector<string>& path, int pos) {
    if (pos == path.size()) return;
    for (int i = 0; i < (int)(sub.size()); ++i) {
      if (sub[i].name == path[pos]) {
        sub[i].makeTree(path, pos + 1);
        return;
      }
    }
    sub.push_back(Tree(path[pos]));
    sub[sub.size() - 1].makeTree(path, pos + 1);
  }
  int cntFolder() {
    if (sub.size() == 0) return 0;
    int ret = 0;
    for (int i = 0; i < (int)(sub.size()); ++i) {
      ret += sub[i].cntFolder();
      if (sub[i].sub.size() > 0) ++ret;
    }
    return ret;
  }
  int cntFile() {
    if (sub.size() == 0) return 1;
    int ret = 0;
    for (int i = 0; i < (int)(sub.size()); ++i) {
      ret += sub[i].cntFile();
    }
    return ret;
  }
};
Tree disk[10];
string ROOT = "CDEFG";
int getIdx(string root) {
  for (int i = 0; i < (int)(ROOT.length()); ++i)
    if (ROOT[i] == root[0]) return i;
}
void parsePath(string s) {
  for (int i = 0; i < (int)(s.length()); ++i) {
    if (s[i] == '\\' || s[i] == ':') s[i] = ' ';
  }
  istringstream iss(s);
  string root;
  iss >> root;
  string sub;
  vector<string> vs;
  while (iss >> sub) {
    vs.push_back(sub);
  }
  disk[getIdx(root)].makeTree(vs, 0);
}
int main() {
  string s;
  while (cin >> s) {
    parsePath(s);
  }
  int rFolder = 0, rFile = 0;
  for (int i = 0; i < (int)(ROOT.length()); ++i) {
    for (int j = 0; j < (int)(disk[i].sub.size()); ++j) {
      int cFolder = disk[i].sub[j].cntFolder(),
          cFile = disk[i].sub[j].cntFile();
      rFolder = max(rFolder, cFolder);
      rFile = max(rFile, cFile);
    }
  }
  cout << rFolder << " " << rFile << endl;
  return 0;
}
