#include <bits/stdc++.h>
using namespace std;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 1e5 + 10, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
int casenum, casei;
int n;
char a[N][50], s[50];
map<string, set<string>> SerToPath;
map<set<string>, set<string>> PathToSer;
map<set<string>, set<string>>::iterator it;
set<string>::iterator itt;
int main() {
  while (~scanf("%d", &n)) {
    SerToPath.clear();
    PathToSer.clear();
    for (int i = 1; i <= n; ++i) {
      scanf("%s", s);
      int l = strlen(s);
      int j;
      for (j = 7; j < l; ++j)
        if (s[j] == '/') break;
      if (j == l)
        SerToPath[s].insert("^");
      else {
        s[j] = 0;
        SerToPath[s].insert(s + j + 1);
      }
      strcpy(a[i], s);
    }
    for (int i = 1; i <= n; ++i) {
      strcpy(s, a[i]);
      if (SerToPath.count(s)) {
        PathToSer[SerToPath[s]].insert(s);
        SerToPath.erase(s);
      }
    }
    int ans = 0;
    for (it = PathToSer.begin(); it != PathToSer.end(); ++it) {
      if (it->second.size() > 1) ++ans;
    }
    printf("%d\n", ans);
    for (it = PathToSer.begin(); it != PathToSer.end(); ++it) {
      if (it->second.size() > 1) {
        for (itt = it->second.begin(); itt != it->second.end(); ++itt) {
          cout << *itt << " ";
        }
        puts("");
      }
    }
  }
  return 0;
}
