#include <bits/stdc++.h>
using namespace std;
const long long p = 257, MOD = 1e9 + 7;
vector<long long> pows(200, 1);
map<long long, vector<string> > g;
map<long long, int> folder_cnt;
map<long long, int> file_cnt;
long long hash_it(const string &s, int len) {
  long long hash_ = 0;
  for (int i = 0; i < s.size(); ++i) {
    hash_ += (long long)(s[i] - 42) * pows[i + len];
    hash_ %= MOD;
  }
  return hash_;
}
void dfs(long long hash_, int len) {
  for (auto &e : g[hash_]) {
    if (e.find('.') != string ::npos)
      file_cnt[hash_]++;
    else {
      folder_cnt[hash_]++;
      long long cur = (hash_ + hash_it(e, len)) % MOD;
      dfs(cur, len + e.size());
      folder_cnt[hash_] += folder_cnt[cur];
      file_cnt[hash_] += file_cnt[cur];
    }
  }
}
int main() {
  for (int i = 1; i < pows.size(); ++i) {
    pows[i] = (pows[i - 1] * p) % MOD;
  }
  string word;
  while (getline(cin, word) && word.compare("\0") != 0) {
    long long hash_ = 0;
    word += (char)(92);
    for (int i = 0; i < word.size(); ++i) {
      hash_ += (long long)(word[i] - 42) * pows[i];
      hash_ %= MOD;
      if (word[i] == 92) {
        string sub = "";
        for (int j = i + 1; j < word.size(); ++j) {
          sub += word[j];
          if (word[j] == 92) break;
        }
        if (!sub.empty()) g[hash_].push_back(sub);
      }
    }
  }
  for (auto &e : g) {
    sort(e.second.begin(), e.second.end());
    auto ee = unique(e.second.begin(), e.second.end());
    e.second.resize(distance(e.second.begin(), ee));
  }
  int max_fold = 0, max_file = 0;
  for (char i = 'C'; i <= 'G'; ++i) {
    long long hash_ = hash_it(((string){i, ':', (char)92}), 0);
    dfs(hash_, 3);
    for (auto &e : g[hash_]) {
      long long cur = (hash_ + hash_it(e, 3)) % MOD;
      max_fold = max(max_fold, folder_cnt[cur]);
      max_file = max(max_file, file_cnt[cur]);
    }
  }
  cout << max_fold << ' ' << max_file;
}
