#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, set<string>> hostnamesToPaths;
  const string pathDelimiter = "@";
  const int hostnameStart = 7;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    auto slashPos = s.find('/', hostnameStart);
    if (slashPos == string::npos) slashPos = s.length();
    string hostname = s.substr(hostnameStart, slashPos - hostnameStart);
    string path = s.substr(slashPos, s.length() - slashPos);
    if (hostnamesToPaths.find(hostname) == hostnamesToPaths.end()) {
      hostnamesToPaths[hostname] = set<string>();
    }
    hostnamesToPaths[hostname].insert(path);
  }
  unordered_map<string, set<string>> groups;
  for (const auto& x : hostnamesToPaths) {
    string pathsConcatenated;
    for (const auto& s : x.second) {
      pathsConcatenated += pathDelimiter + s;
    }
    if (groups.find(pathsConcatenated) == groups.end()) {
      groups[pathsConcatenated] = set<string>();
    }
    groups[pathsConcatenated].insert(x.first);
  }
  vector<set<string>> result;
  for (const auto& x : groups) {
    if (x.second.size() >= 2) {
      result.push_back(x.second);
    }
  }
  cout << result.size() << endl;
  for (const auto& x : result) {
    for (const auto& s : x) {
      cout << "http://" << s << " ";
    }
    cout << endl;
  }
  return 0;
}
