#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
const long long INFll = 1ll * INF * INF;
const long double ldINF = 1e+018;
const long double EPS = 0.000000001;
const int base = INF;
string host, path;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  set<string> st;
  map<string, int> m_path;
  map<string, vector<int> > m_host;
  int cur = 0;
  for (int i = 0; i < n; i++) {
    host = path = "";
    string s;
    cin >> s;
    if (st.count(s) != 0) continue;
    st.insert(s);
    s = s.substr(7, s.size() - 7);
    int num = -1;
    for (int j = 0; j < s.size(); j++)
      if (s[j] != '/')
        host += s[j];
      else {
        num = j;
        break;
      }
    if (num != -1)
      path = s.substr(num, s.size() - num);
    else
      path = ' ';
    if (m_path[path] == 0)
      num = ++cur, m_path[path] = cur;
    else
      num = m_path[path];
    m_host[host].push_back(num);
  }
  n = st.size();
  map<vector<int>, vector<string> > group;
  for (auto it = m_host.begin(); it != m_host.end(); it++) {
    vector<int> v = it->second;
    sort(v.begin(), v.end());
    group[v].push_back(it->first);
  }
  vector<vector<string> > ans;
  for (auto it = group.begin(); it != group.end(); it++)
    if (group[it->first].size() > 1) ans.push_back(it->second);
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) {
    for (int j = 0; j < ans[i].size(); j++)
      cout << "http://" << ans[i][j] << ' ';
    cout << endl;
  }
  return 0;
}
