#include <bits/stdc++.h>
using namespace std;
struct node {
  string str;
  vector<node*> vect;
};
map<char, node*> mp;
bool is(string str) {
  for (long long i = 0; i < str.size(); i++) {
    if (str[i] == '.') return true;
  }
  return false;
}
void fun(node* root, string str1, long long x) {
  string temp = "";
  long long index = 0;
  for (long long i = x; i < str1.size(); i++) {
    if (str1[i] == '\\') {
      index = i + 1;
      break;
    }
    temp.push_back(str1[i]);
  }
  if (index == 0) {
    node* t = new node;
    root->vect.push_back(t);
    t->str = temp;
    return;
  }
  for (long long i = 0; i < root->vect.size(); i++) {
    if (root->vect[i]->str == temp) {
      fun(root->vect[i], str1, index);
      return;
    }
  }
  node* t = new node;
  root->vect.push_back(t);
  t->str = temp;
  fun(t, str1, index);
}
long long ans = 0, coun = 0;
void inorder(node* root) {
  if (is(root->str)) {
    coun++;
    return;
  }
  ans++;
  for (long long i = 0; i < root->vect.size(); i++) {
    inorder(root->vect[i]);
  }
}
int main() {
  string str1;
  while (cin >> str1) {
    if (mp[str1[0]] == NULL) {
      node* root = new node;
      root->str = str1[0];
      mp[str1[0]] = root;
    }
    fun(mp[str1[0]], str1, 3);
  }
  map<char, node*>::iterator it = mp.begin();
  pair<long long, long long> sol = make_pair(0, 0);
  for (it; it != mp.end(); it++) {
    for (long long i = 0; i < it->second->vect.size(); i++) {
      inorder(it->second->vect[i]);
      sol.first = max(sol.first, ans);
      sol.second = max(sol.second, coun);
      ans = 0;
      coun = 0;
    }
  }
  cout << sol.first - 1 << " " << sol.second;
}
