#include <bits/stdc++.h>
using namespace std;
int N;
char url[256];
unordered_map<string, set<string>> UM;
unordered_map<string, unordered_set<string>> UMM;
int main() {
  scanf("%d", &N);
  for (int n = 0; n < N; ++n) {
    scanf("%s", url);
    auto slash = strchr(url + 7, '/');
    if (slash == nullptr) {
      slash = strchr(url + 7, '\0');
    }
    string host(url + 7, slash);
    UM[string(url + 7, slash)].insert(string(slash));
  }
  for (const auto& p : UM) {
    string c;
    for (const auto& s : p.second) {
      c += ":";
      c += s;
    }
    UMM[c].insert(p.first);
  }
  int count = 0;
  for (const auto& p : UMM) {
    if (p.second.size() > 1) {
      ++count;
    }
  }
  printf("%d\n", count);
  for (const auto& p : UMM) {
    if (p.second.size() > 1) {
      for (const auto& s : p.second) {
        printf("http://%s ", s.data());
      }
      printf("\n");
    }
  }
  return 0;
}
