#include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 100;
const int INF = 0x3f3f3f3f;
struct Node {
  string name;
  int num;
  bool operator<(const Node& rhs) const { return name < rhs.name; }
  bool operator==(const Node& rhs) const { return name == rhs.name; }
  Node() {}
  Node(string x, int y) {
    name = x;
    num = y;
  }
} a[maxn], b[maxn];
vector<Node> file, folder;
map<string, pair<int, int> > aa, bb;
map<string, set<string> > E, F;
int main() {
  string str, ss;
  file.clear();
  folder.clear();
  int ans1 = 0, ans2 = 0;
  int cnta = 0;
  int cntb = 0;
  aa.clear();
  bb.clear();
  E.clear();
  F.clear();
  while (cin >> str) {
    ss = "";
    int num = 0;
    int len = str.size();
    string temp = "";
    string xx = "\\\\";
    int x = xx[0];
    for (int i = 0; i < len; ++i) {
      temp += str[i];
      if (i == len - 1 && num >= 2) {
        E[ss].insert(temp);
        continue;
      }
      if (str[i + 1] == 92 && num >= 2) {
        F[ss].insert(temp);
      }
      if (str[i] == 92) num++;
      if (num == 1 && str[i + 1] == 92) {
        ss = temp;
      }
    }
  }
  for (auto itr : F) {
    int x = itr.second.size();
    ans1 = max(ans1, x);
  }
  for (auto itr : E) {
    int x = itr.second.size();
    ans2 = max(ans2, x);
  }
  cout << ans1 << " " << ans2 << "\n";
  return 0;
}
