#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const long long int N = 1e6;
long long int mod = 998244353;
long long int dx[4] = {0, 0, +1, -1};
long long int dy[4] = {+1, -1, 0, 0};
map<string, set<string> > folders, files;
long long int max1, max2;
void solve() {
  string s;
  while (cin >> s) {
    long long int cnt = 0, q = 0;
    while (cnt < 2) {
      ++q;
      if (s[q] == '\\') {
        cnt++;
      }
      if (cnt == 2) break;
    }
    long long int qq = q;
    string temp = "";
    for (long long int i = 0; i < q + 1; i++) temp += s[i];
    files[temp].insert(s);
    long long int len = (long long int)s.size();
    while (1) {
      --len;
      while (s[len] != '\\') --len;
      if (len == qq) break;
      string temp1 = "";
      for (long long int i = 0; i < len + 1; i++) temp1 += s[i];
      folders[temp].insert(temp1);
    }
  }
  for (auto to : folders) {
    long long int nsz = (long long int)to.second.size();
    max1 = max(max1, nsz);
  }
  for (auto to : files) {
    long long int nsz = (long long int)to.second.size();
    max2 = max(max2, nsz);
  }
  cout << max1 << " " << max2 << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  while (t--) solve();
  return 0;
}
