#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int nmax = 100005;
const long long inf = 1e9;
const double eps = 1e-12;
map<int, string> toans;
map<string, int> id1;
map<string, int> id2;
pair<vector<int>, int> a[nmax];
int p[nmax];
int used[nmax];
vector<vector<string> > v;
bool f(pair<vector<int>, int> a, pair<vector<int>, int> b) {
  if (a.first.size() != b.first.size()) {
    return a.first.size() < b.first.size();
  }
  for (int i = 0; i < a.first.size(); ++i) {
    int cura = a.first[i];
    int curb = b.first[i];
    if (cura != curb) {
      return cura < curb;
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int cnt1 = 1;
  int cnt2 = 1;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    string dop = "";
    string pt = "";
    int j;
    for (j = 7; j < s.size(); ++j) {
      if (s[j] == '/') break;
      dop += s[j];
    }
    for (; j < s.size(); ++j) {
      pt += s[j];
    }
    if (!id1[dop]) id1[dop] = cnt1++;
    if (!id2[pt]) id2[pt] = cnt2++;
    a[id1[dop]].first.push_back(id2[pt]);
    a[id1[dop]].second = id1[dop];
    toans[id1[dop]] = "http://" + dop;
  }
  for (int i = 1; i <= cnt1; ++i) {
    sort(a[i].first.begin(), a[i].first.end());
    a[i].first.erase(unique(a[i].first.begin(), a[i].first.end()),
                     a[i].first.end());
  }
  sort(a + 1, a + cnt1 + 1, f);
  for (int i = 2; i <= cnt1; ++i) {
    int sz = a[i].first.size();
    int ss = a[i - 1].first.size();
    if (sz != ss) continue;
    int flag = 0;
    for (int j = 0; j < sz; ++j) {
      int cura = a[i].first[j];
      int curb = a[i - 1].first[j];
      if (cura != curb) {
        flag = 1;
        break;
      }
    }
    if (!flag) {
      p[a[i].second] = a[i - 1].second;
    }
  }
  v.assign(cnt1 + 1, vector<string>());
  int c1 = 0;
  for (int i = cnt1; i; --i) {
    int cur = a[i].second;
    if (used[cur]) continue;
    while (cur && !used[cur]) {
      v[i].push_back(toans[cur]);
      used[cur] = 1;
      cur = p[cur];
    }
    if (v[i].size() > 1) {
      c1++;
    }
  }
  cout << c1 << '\n';
  for (int i = cnt1; i; --i) {
    if (v[i].size() > 1) {
      for (int j = 0; j < v[i].size(); ++j) {
        cout << v[i][j] << ' ';
      }
      cout << '\n';
    }
  }
  return 0;
}
