#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
struct pi {
  int id;
  vector<string> g;
  int p;
} pp[maxn];
struct ppi {
  string f1;
  string f2;
} pp1[maxn];
string s[maxn];
int cmp(ppi a, ppi b) {
  if (a.f1 != b.f1) return a.f1 < b.f1;
  return a.f2 < b.f2;
}
int cmp1(pi a, pi b) {
  if (a.p != b.p) return a.p < b.p;
  for (int i = 0; i < a.p; i++) {
    if (a.g[i] != b.g[i]) {
      return a.g[i] < b.g[i];
    }
  }
  return a.id < b.id;
}
int pre[maxn];
int vis[maxn];
int main() {
  int i, j, n, m;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> s[i];
  sort(s + 1, s + 1 + n);
  m = 0;
  for (i = 1; i <= n; i++) {
    if (i == 1 || s[i] != s[i - 1]) s[++m] = s[i];
  }
  n = m;
  for (i = 1; i <= n; i++) {
    pp1[i].f1 = "";
    for (j = 0; j <= 6; j++) {
      pp1[i].f1 += s[i][j];
    }
    int p = s[i].length();
    for (j = 7; j < p && s[i][j] != '/'; j++) {
      pp1[i].f1 += s[i][j];
    }
    pp1[i].f2 = "&";
    for (; j < p; j++) {
      pp1[i].f2 += s[i][j];
    }
  }
  sort(pp1 + 1, pp1 + n + 1, cmp);
  m = 0;
  for (i = 1; i <= n; i++) {
    if (i == 1 || pp1[i].f1 != pp1[i - 1].f1) {
      pp[++m].id = i;
      int q = i;
      pp[m].p = 0;
      while (q <= n && pp1[q].f1 == pp1[i].f1) {
        pp[m].g.push_back(pp1[q].f2);
        pp[m].p++;
        q++;
      }
      i = q - 1;
    }
  }
  sort(pp + 1, pp + 1 + m, cmp1);
  for (i = 1; i <= m; i++) {
    pre[i] = i;
    if (i == 1 || pp[i].p != pp[i - 1].p) continue;
    int f = 0;
    for (j = 0; j < pp[i].p; j++) {
      if (pp[i - 1].g[j] != pp[i].g[j]) {
        f = 1;
        break;
      }
    }
    if (f == 0) {
      pre[i] = pre[i - 1];
      vis[pre[i]]++;
    }
  }
  int k = 0;
  for (i = 1; i <= m; i++) {
    if (vis[i] > 0) {
      k++;
    }
  }
  printf("%d\n", k);
  for (i = 1; i <= m; i++) {
    if (vis[i] == 0) continue;
    int p = i;
    while (p <= m && pre[p] == i) {
      cout << pp1[pp[p].id].f1 << " ";
      p++;
    }
    printf("\n");
    i = p - 1;
  }
}
