#include <bits/stdc++.h>
using namespace std;
unordered_map<string, int> Hosts;
unordered_map<string, int> Paths;
vector<set<int> > vs;
vector<string> id_to_host;
char buffer[53];
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int hosts_count = 0;
  int paths_count = 0;
  for (int i = 0; i < n; i++) {
    string s(buffer);
    cin >> s;
    s = s.substr(7);
    int Path_start = s.find('/');
    string host;
    string path;
    if (Path_start != -1) {
      host = s.substr(0, Path_start);
      path = s.substr(Path_start);
    } else {
      host = s;
      path = "";
    }
    if (!Hosts.count(host)) {
      Hosts[host] = hosts_count++;
      id_to_host.push_back(host);
      vs.push_back(set<int>());
    }
    if (!Paths.count(path)) {
      Paths[path] = ++paths_count;
    }
    vs[Hosts[host]].insert(Paths[path]);
  }
  Paths.clear();
  Hosts.clear();
  map<set<int>, vector<int> > groups;
  for (unsigned i = 0; i < vs.size(); i++) {
    if (groups.find(vs[i]) == groups.end()) groups[vs[i]] = vector<int>();
    groups[vs[i]].push_back(i);
  }
  unsigned count = 0;
  for (auto &iter : groups) {
    if (iter.second.size() > 1) {
      count++;
    }
  }
  cout << count << '\n';
  for (auto &iter : groups) {
    if (iter.second.size() > 1) {
      for (auto it : iter.second) {
        cout << "http://" << id_to_host[it] << ' ';
      }
      cout << '\n';
    }
  }
  return 0;
}
