#include <bits/stdc++.h>
using namespace std;
int n;
set<string> values[100010];
string values_name[100010];
vector<string> v_groups[100010];
int cant;
void get_info(string cad, string &cad1, string &cad2) {
  int pos = 7;
  bool dir_flag = false;
  cad1 = "http://";
  cad2 = "";
  for (int i = 7; i < cad.size(); i++) {
    if (!dir_flag && cad[i] == '/') dir_flag = true;
    if (dir_flag)
      cad2 += cad[i];
    else
      cad1 += cad[i];
  }
}
int main() {
  cin >> n;
  string dir;
  cant = 0;
  string hostname, path;
  unordered_map<string, int> index;
  for (int i = 0; i < n; i++) {
    cin >> dir;
    get_info(dir, hostname, path);
    auto it = index.find(hostname);
    if (it != index.end()) {
      values[it->second].insert(path);
    } else {
      set<string> paths;
      paths.insert(path);
      index[hostname] = cant;
      values_name[cant] = hostname;
      values[cant++] = paths;
    }
  }
  unordered_map<string, int> groups;
  int g_cont = 0;
  for (int i = 0; i < cant; i++) {
    string rehash = "";
    for (auto const &ele : values[i]) {
      rehash += ele;
      rehash += "$";
    }
    auto it = groups.find(rehash);
    if (it != groups.end()) {
      v_groups[it->second].push_back(values_name[i]);
    } else {
      vector<string> res_g;
      res_g.push_back(values_name[i]);
      groups[rehash] = g_cont;
      v_groups[g_cont++] = res_g;
    }
  }
  int r_count = 0;
  for (int i = 0; i < g_cont; i++) {
    if (v_groups[i].size() > 1) r_count++;
  }
  cout << r_count << endl;
  for (int i = 0; i < g_cont; i++) {
    if (v_groups[i].size() > 1) {
      cout << v_groups[i][0];
      for (int j = 1; j < v_groups[i].size(); j++) {
        cout << " " << v_groups[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}
