#include <bits/stdc++.h>
using namespace std;
vector<pair<string, string> > a;
int main() {
  int n;
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    char s[50];
    fgets(s, 50, stdin);
    char host[25] = "", path[25] = "";
    sscanf(s, "http://%[^/\n]%s", host, path);
    a.push_back(make_pair(host, path));
  }
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  for (int i = 0, j = 1; j < a.size(); j++) {
    if (a[i].first == a[j].first) {
      a[i].second += "|" + a[j].second;
      a[j] = pair<string, string>();
    } else {
      i = j;
    }
  }
  a.erase(remove(a.begin(), a.end(), pair<string, string>()), a.end());
  sort(a.begin(), a.end(),
       [](const pair<string, string> &x, const pair<string, string> &y) {
         return x.second < y.second;
       });
  a[0].first = "http://" + a[0].first;
  for (int i = 0, j = 1; j < a.size(); j++) {
    if (a[i].second == a[j].second) {
      a[i].first += " http://" + a[j].first;
      a[j] = make_pair("", "");
    } else {
      i = j;
      a[i].first = "http://" + a[i].first;
    }
  }
  a.erase(remove_if(a.begin(), a.end(),
                    [](const pair<string, string> &x) {
                      return x.first.find(' ') == string::npos;
                    }),
          a.end());
  cout << a.size() << "\n";
  for (int i = 0; i < a.size(); i++) cout << a[i].first << "\n";
}
