#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> urls(n);
  char buffer[1000];
  for (int i = 0; i < n; ++i) {
    scanf("%s", buffer);
    urls[i] = buffer;
  }
  map<string, set<string>> hostname_to_paths;
  for (int i = 0; i < n; ++i) {
    string hostname = "";
    int index = 7;
    while (index < urls[i].length() && urls[i][index] != '/') {
      hostname += urls[i][index];
      ++index;
    }
    if (index == urls[i].length()) {
      hostname_to_paths[hostname].insert("");
      continue;
    }
    string path = "";
    while (index < urls[i].length()) {
      path += urls[i][index];
      ++index;
    }
    hostname_to_paths[hostname].insert(path);
  }
  map<set<string>, vector<string>> hostname_groups;
  for (map<string, set<string>>::const_iterator it = hostname_to_paths.begin();
       it != hostname_to_paths.end(); ++it) {
    hostname_groups[it->second].push_back(it->first);
  }
  vector<vector<string>> result;
  for (map<set<string>, vector<string>>::const_iterator it =
           hostname_groups.begin();
       it != hostname_groups.end(); ++it) {
    if (it->second.size() == 1) {
      continue;
    }
    result.push_back(it->second);
  }
  cout << result.size() << endl;
  for (int i = 0; i < result.size(); ++i) {
    for (int j = 0; j < result[i].size(); ++j) {
      printf("http://%s ", result[i][j].c_str());
    }
    printf("\n");
  }
  return 0;
}
