#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
struct node {
  string name;
  vector<node *> edges;
  bool file = false;
  bool disk = false;
};
void add(node &n, list<string> &l, bool disk) {
  n.name = *l.begin();
  n.disk = disk;
  if (l.size() == 1) {
    n.file = true;
  }
  l.erase(l.begin());
  if (l.empty()) return;
  string cur = *l.begin();
  for (__typeof(n.edges.size()) i = (0) - ((0) > (n.edges.size()));
       i != (n.edges.size()) - ((0) > (n.edges.size()));
       i += 1 - 2 * ((0) > (n.edges.size()))) {
    if (n.edges[i]->name == cur) {
      add(*(n.edges[i]), l, false);
      return;
    }
  }
  n.edges.push_back(new node());
  add(*(n.edges.back()), l, false);
}
pair<int, int> dfs(node &n, bool cont) {
  if (n.disk) {
    pair<int, int> res = {0, 0};
    for (__typeof(n.edges.size()) i = (0) - ((0) > (n.edges.size()));
         i != (n.edges.size()) - ((0) > (n.edges.size()));
         i += 1 - 2 * ((0) > (n.edges.size()))) {
      auto cur = dfs(*(n.edges[i]), true);
      res = {max(cur.first, res.first), max(cur.second, res.second)};
    }
    return res;
  }
  int a = 0, b = 0;
  if (n.file) {
    return {0, 1};
  }
  for (__typeof(n.edges.size()) i = (0) - ((0) > (n.edges.size()));
       i != (n.edges.size()) - ((0) > (n.edges.size()));
       i += 1 - 2 * ((0) > (n.edges.size()))) {
    auto cur = dfs(*(n.edges[i]), false);
    a += cur.first;
    b += cur.second;
  }
  if (!cont) a++;
  return {a, b};
}
int main() {
  string str;
  node root = node();
  root.disk = true;
  root.name = "root";
  while (getline(cin, str)) {
    list<string> files;
    string cur;
    for (__typeof(str.size()) i = (0) - ((0) > (str.size()));
         i != (str.size()) - ((0) > (str.size()));
         i += 1 - 2 * ((0) > (str.size()))) {
      if (str[i] == ':') {
        files.insert(files.end(), cur);
        cur = "";
        i++;
      } else if (str[i] == '\\') {
        files.insert(files.end(), cur);
        cur = "";
      } else
        cur += str[i];
    }
    files.insert(files.end(), cur);
    cur = *files.begin();
    bool f = false;
    for (__typeof(root.edges.size()) i = (0) - ((0) > (root.edges.size()));
         i != (root.edges.size()) - ((0) > (root.edges.size()));
         i += 1 - 2 * ((0) > (root.edges.size()))) {
      if (root.edges[i]->name == cur) {
        add(*(root.edges[i]), files, true);
        f = true;
        break;
      }
    }
    if (!f) {
      root.edges.push_back(new node());
      add(*(root.edges.back()), files, true);
    }
  }
  auto res = dfs(root, true);
  cout << res.first << ' ' << res.second << endl;
  return 0;
}
