#include <bits/stdc++.h>
using namespace std;
queue<long long> q;
pair<long long, long long> a[400005];
string s[400005];
char c[400005];
void pr(vector<string> v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
int main() {
  int n, b;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < s[i].size(); j++)
      if (s[i][j] == '.') s[i][j] = ':';
  }
  sort(s, s + n);
  vector<string> v, las, ne;
  string last;
  vector<vector<string> > an;
  an.push_back(ne);
  string ss, ss1;
  vector<pair<vector<string>, string> > rao;
  for (int i = 0; i < n; i++) {
    if (i && s[i] == s[i - 1]) continue;
    int j;
    ss = ss1 = "";
    for (j = 0; j < s[i].size(); j++)
      if (s[i][j] == '/' && j >= 7)
        break;
      else
        ss += s[i][j];
    for (; j < s[i].size(); j++) ss1 += s[i][j];
    if (ss == last) {
      v.push_back(ss1);
    } else {
      rao.push_back(make_pair(v, last));
      las = v;
      v.clear();
      v.push_back(ss1);
      last = ss;
    }
  }
  rao.push_back(make_pair(v, last));
  for (int i = 0; i < rao.size(); i++)
    sort(rao[i].first.begin(), rao[i].first.end());
  sort(rao.begin(), rao.end());
  for (int i = 0; i < rao.size(); i++) {
    if (!i || rao[i].first != rao[i - 1].first) an.push_back(ne);
    an.back().push_back(rao[i].second);
  }
  int k = 0;
  for (int i = 0; i < an.size(); i++) {
    if (an[i].size() < 2) continue;
    k++;
  }
  cout << k << endl;
  string ou;
  for (int i = 0; i < an.size(); i++) {
    if (an[i].size() < 2) continue;
    for (int j = 0; j < an[i].size(); j++) {
      ou = an[i][j];
      for (int i = 0; i < ou.size(); i++)
        if (i >= 7 && ou[i] == ':')
          printf(".");
        else
          printf("%c", ou[i]);
      printf(" ");
    }
    printf("\n");
  }
  cin >> n;
}
