#include <bits/stdc++.h>
using namespace std;
template <class T>
T inline sqr(T x) {
  return x * x;
}
const long double pi = 3.1415926535897932384626433832795;
const long double eps = 1e-8;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<string, set<string>> M;
  string tmp;
  for (int i = 0; i < (int)(n); ++i) {
    string s;
    cin >> s;
    tmp = s.substr(0, 7);
    s = s.substr(7);
    auto p = s.find("/");
    string name = s.substr(0, p);
    string to;
    if (p != -1) to = s.substr(p);
    M[name].insert(to);
  }
  map<string, vector<string>> S;
  for (auto w : M) {
    string t;
    for (auto y : w.second) t += y + " : ";
    S[t].push_back(w.first);
  }
  vector<string> ans;
  for (auto w : S)
    if (w.second.size() > 1) {
      string c;
      for (auto x : w.second) c += tmp + x + " ";
      ans.push_back(c);
    }
  cout << ans.size() << "\n";
  for (auto x : ans) cout << x << "\n";
  return 0;
}
