#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 100;
char line[N + 1];
int n_pool, ans[2];
struct folder {
  unordered_map<string, folder *> folders;
  int n_file;
} pool[N * N / 2];
unordered_map<string, folder *> disk[5];
void insert(unordered_map<string, folder *> &tree, int i, int j) {
  string name(line, i, j - i);
  if (line[j]) {
    folder *f = tree[name];
    if (!f) f = tree[name] = &pool[n_pool++];
    i = j + 1, j = i + 1;
    while (line[j] && line[j] != '\\') j++;
    insert(f->folders, i, j);
    f->n_file++;
  }
}
int dfs(folder *f) {
  int n = 0;
  for (auto &kv : f->folders) n += dfs(kv.second);
  ans[0] = max(ans[0], n);
  ans[1] = max(ans[1], f->n_file);
  return n + 1;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  while (cin >> line) {
    int j = 4;
    while (line[j] != 0 && line[j] != '\\') j++;
    insert(disk[line[0] - 'C'], 3, j);
  }
  for (auto &d : disk) {
    for (auto &kv : d) {
      dfs(kv.second);
    }
  }
  cout << ans[0] << ' ' << ans[1] << endl;
  return 0;
}
