#include <bits/stdc++.h>
using namespace std;
const int maxn = 101 * 1000;
const string httpstart = "http://";
map<string, int> pathId;
vector<string> v[maxn];
map<string, int> clusterId;
int countOfClusters = 1;
set<string> cluster[maxn];
int n;
string readHost(string s, int start) {
  string ans = "";
  unsigned int index = start;
  while (index < s.size() && s[index] != '/') {
    ans += s[index];
    ++index;
  }
  return ans;
}
string readPath(string s, int start) { return s.substr(start); }
vector<string> neighbourInCluster[maxn];
set<int> neighbourClusters;
void breakClustersBy(int id) {
  for (unsigned int i = 0; i < v[id].size(); ++i) {
    string s = v[id][i];
    int clusterNumber = clusterId[s];
    neighbourClusters.insert(clusterNumber);
    neighbourInCluster[clusterNumber].push_back(s);
  }
  for (auto const &i : neighbourClusters) {
    if (neighbourInCluster[i].size() != cluster[i].size()) {
      for (auto const &s : neighbourInCluster[i]) {
        clusterId[s] = countOfClusters;
        cluster[countOfClusters].insert(s);
        cluster[i].erase(s);
      }
      ++countOfClusters;
    }
  }
  for (auto const &i : neighbourClusters) {
    neighbourInCluster[i].clear();
  }
  neighbourClusters.clear();
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    string host, path;
    host = readHost(s, httpstart.size());
    path = readPath(s, httpstart.size() + host.size());
    cluster[0].insert(host);
    clusterId[host] = 0;
    int pathNumber = pathId.size();
    if (pathId.count(path)) {
      pathNumber = pathId[path];
    } else {
      pathId[path] = pathNumber;
    }
    v[pathNumber].push_back(host);
  }
  for (int i = 0; i < n; ++i) {
    breakClustersBy(i);
  }
  vector<int> bigClusters;
  for (int i = 0; i < n; ++i) {
    if (cluster[i].size() > 1) {
      bigClusters.push_back(i);
    }
  }
  cout << bigClusters.size() << endl;
  for (unsigned int i = 0; i < bigClusters.size(); ++i) {
    for (auto const &s : cluster[bigClusters[i]]) {
      cout << httpstart << s << " ";
    }
    cout << endl;
  }
  return 0;
}
