#include <bits/stdc++.h>
using namespace std;
int nxt() {
  int first;
  scanf("%d", &first);
  return first;
}
pair<string, string> get(string s) {
  s = s.substr(7);
  int i = 0;
  while (i < s.length() && s[i] != '/') {
    ++i;
  }
  pair<string, string> ret;
  ret.first = s.substr(0, i);
  ret.second = s.substr(i);
  return ret;
}
void prepare(vector<string> &v) {
  sort((v).begin(), (v).end());
  v.resize(unique((v).begin(), (v).end()) - v.begin());
}
vector<string> servers;
vector<string> paths;
vector<pair<string, string> > in;
int getServer(const string &s) {
  int pos =
      lower_bound((servers).begin(), (servers).end(), s) - servers.begin();
  return pos;
}
int getPath(const string &s) {
  int pos = lower_bound((paths).begin(), (paths).end(), s) - paths.begin();
  return pos;
}
const int N = 100 * 1000;
vector<int> g[N];
vector<string> myPath;
vector<string> serversPaths;
vector<int> groups[N];
int getServerPaths(const string &s) {
  int pos = lower_bound((serversPaths).begin(), (serversPaths).end(), s) -
            serversPaths.begin();
  return pos;
}
void solve() {
  int n;
  cin >> n;
  in.resize(n);
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    in[i] = get(s);
  }
  servers.resize(n);
  paths.resize(n);
  for (int i = 0; i < n; ++i) {
    servers[i] = in[i].first;
    paths[i] = in[i].second;
  }
  prepare(servers);
  prepare(paths);
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; ++i) {
    a[i].first = getServer(in[i].first);
    a[i].second = getPath(in[i].second);
  }
  for (int i = 0; i < n; ++i) {
    g[a[i].first].push_back(a[i].second);
  }
  myPath.resize(n);
  serversPaths.resize(servers.size());
  for (int i = 0; i < servers.size(); ++i) {
    string ps;
    sort((g[i]).begin(), (g[i]).end());
    g[i].resize(unique((g[i]).begin(), (g[i]).end()) - g[i].begin());
    for (int j = 0; j < g[i].size(); ++j) {
      if (j) ps += "-";
      ps += to_string(g[i][j]);
    }
    serversPaths[i] = ps;
    myPath[i] = ps;
  }
  prepare(serversPaths);
  for (int i = 0; i < servers.size(); ++i) {
    groups[getServerPaths(myPath[i])].push_back(i);
  }
  vector<vector<int> > ans;
  for (int i = 0; i < serversPaths.size(); ++i) {
    if (groups[i].size() == 1) continue;
    ans.push_back(groups[i]);
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); ++i) {
    for (int j = 0; j < ans[i].size(); ++j) {
      if (j) cout << " ";
      cout << "http://" << servers[ans[i][j]];
    }
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  for (int i = 0; i < (int)(t); i++) {
    solve();
  }
  return 0;
}
