#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
using namespace std;
int n, m, mh, mp, cnt;
char host[100010][100];
map<string, int> hh, hp;
map<unsigned long long, int> h;
set<int> a[100010];
vector<int> ans[100010];

int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		char addr[100], path[100];
		scanf("%s", addr);
		strcat(addr, "/");
		char *pos = strchr(addr + 7, '/');
		strcpy(path, pos);
		*pos = 0;
		if (!hh[addr])
		{
			hh[addr] = ++mh;
			strcpy(host[mh], addr);
		}
		if (!hp[path])
			hp[path] = ++mp;
		a[hh[addr]].insert(hp[path]);
	}
	for (int i = 1; i <= mh; i++)
	{
		unsigned long long val = 0;
		for (set<int>::iterator it = a[i].begin(); it != a[i].end(); it++)
		{
			char num[10];
			sprintf(num, "%d/", *it);
			int len = strlen(num);
			for (int j = 0; j < len; j++) val = val * 131 + num[j];
		}
		if (!h[val]) h[val] = ++m;
		ans[h[val]].push_back(i);
	}
	for (int i = 0; i < m; i++)
		if (ans[i].size()>1) cnt++;
	cout << cnt << endl;
	for (int i = 0; i < m; i++)
		if (ans[i].size()>1)
		{
			for (int j = 0; j < ans[i].size(); j++)
				printf("%s ", host[ans[i][j]]);
			puts("");
		}
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
using namespace std;
int n, m, mh, mp, cnt;
char host[100010][100];
map<string, int> hh, hp;
map<unsigned long long, int> h;
set<int> a[100010];
vector<int> ans[100010];

int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		char addr[100], path[100];
		scanf("%s", addr);
		strcat(addr, "/");
		char *pos = strchr(addr + 7, '/');
		strcpy(path, pos);
		*pos = 0;
		if (!hh[addr])
		{
			hh[addr] = ++mh;
			strcpy(host[mh], addr);
		}
		if (!hp[path])
			hp[path] = ++mp;
		a[hh[addr]].insert(hp[path]);
	}
	for (int i = 1; i <= mh; i++)
	{
		unsigned long long val = 0;
		for (set<int>::iterator it = a[i].begin(); it != a[i].end(); it++)
		{
			char num[10];
			sprintf(num, "%d/", *it);
			int len = strlen(num);
			for (int j = 0; j < len; j++) val = val * 131 + num[j];
		}
		if (!h[val]) h[val] = ++m;
		ans[h[val]].push_back(i);
	}
	for (int i = 1; i <= m; i++)
		if (ans[i].size()>1) cnt++;
	cout << cnt << endl;
	for (int i = 1; i <= m; i++)
		if (ans[i].size()>1)
		{
			for (int j = 0; j < ans[i].size(); j++)
				printf("%s ", host[ans[i][j]]);
			puts("");
		}
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<int>
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

ll  mod = 1000000123;
ll  mot = 1000001011;
int n;
string s;
ll  p[100300];
ll  r[100300];
map<string, set<ll> > M;
map<string, set<ll> >::iterator itm;
map<pair<int, ll>, vector<string> > N;
map<pair<int, ll>, vector<string> >::iterator itn;
vector<vector<string> > ans;

ll he(string& t, int b);

int main() {
    ios_base::sync_with_stdio(false);
    p[0] = 271;
    for (int i = 1; i < 100300; ++i)
        p[i] = (p[i - 1] * p[0]) % mod;
    r[0] = 2003;
    for (int i = 1; i < 100300; ++i)
        r[i] = (r[i - 1] * r[0]) % mot;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en + 1 < s.size() && s[en + 1] != '/')
            ++en;
        M[s.substr(7, en - 6)].insert(he(s, en + 1));
    }
    for (itm = M.begin(); itm != M.end(); ++itm) {
        ll  hes = 0;
        int h = 0;
        for (set<ll>::iterator it = itm->sc.begin(); it != itm->sc.end(); ++it, ++h)
            hes = (hes + ((*it) % mot) * r[h]) % mot;
        N[mp(itm->sc.size(), hes)].pb(itm->fs);
    }
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            vector<string> w;
            for (int i = 0; i < itn->sc.size(); ++i)
                w.pb(itn->sc[i]);
            ans.pb(w);
        }
    }
    cout << ans.size() << "\n";
    for (int i = 0; i < ans.size(); ++i) {
        for (int j = 0; j < ans[i].size(); ++j)
            cout << "http://" << ans[i][j] << " ";
        cout << "\n";
    }

    return 0;
}

ll he(string& t, int b) {
    ll res = 0;
    for (int i = 0; i + b < t.size(); ++i)
        res = (res + (ll)(t[i + b]) * p[i]);
    return res;
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<int>
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

ll  mot = 1000000123;
ll  mod = 1000001011;
int n;
string s;
ll  p[300];
ll  r[100300];
map<string, set<ll> > M;
map<string, set<ll> >::iterator itm;
map<ll, vector<string> > N;
map<ll, vector<string> >::iterator itn;

ll he(string& t);
ll hes(set<ll>& S);

int main() {
    ios_base::sync_with_stdio(false);
    p[0] = 59;
    for (int i = 1; i < 300; ++i)
        p[i] = (p[i - 1] * p[0]) % mod;
    r[0] = 271;
    for (int i = 1; i < 100300; ++i)
        r[i] = (r[i - 1] * r[0]) % mot;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en + 1 < s.length() && s[en + 1] != '/')
            ++en;
        string s_ = "";
        for (int j = en + 1; j < s.length(); ++j)
            s_ += s[j];
        string _s = s.substr(0, en + 1);
        M[_s].insert(he(s_));
    }
    for (itm = M.begin(); itm != M.end(); ++itm)
        N[hes(itm->sc)].pb(itm->fs);
    int num = 0;
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            ++num;
        }
    }
    cout << num << "\n";
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            for (int i = 0; i < itn->sc.size(); ++i)
                cout << itn->sc[i] << " ";
            cout << "\n";
        }
    }

    return 0;
}

ll he(string& t) {
    ll res = 177;
    for (int i = 0; i < t.size(); ++i)
        res = (res + (ll)(t[i] + 1) * p[i]) % mod;
    return res;
}

ll hes(set<ll>& S) {
    int h = 0;
    ll res = (S.size() * r[S.size()]) % mot;
    for (set<ll>::iterator it = S.begin(); it != S.end(); ++it)
        res = (res + (*it) * r[h++]) % mot;
    return res;
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<int>
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

ll  mod = 1000000123;
ll  mot = 1000001011;
int n;
string s;
ll  p[100300];
ll  r[100300];
map<string, set<ll> > M;
map<string, set<ll> >::iterator itm;
map<pair<int, ll>, vector<string> > N;
map<pair<int, ll>, vector<string> >::iterator itn;

ll he(string& t);

int main() {
    ios_base::sync_with_stdio(false);
    p[0] = 271;
    for (int i = 1; i < 100300; ++i)
        p[i] = (p[i - 1] * p[0]) % mod;
    r[0] = 2003;
    for (int i = 1; i < 100300; ++i)
        r[i] = (r[i - 1] * r[0]) % mot;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en + 1 < s.size() && s[en + 1] != '/')
            ++en;
        string s_ = "";
        for (int j = en + 1; j < s.length(); ++j)
            s_ += s[j];
        M[s.substr(0, en + 1)].insert(he(s_));
    }
    for (itm = M.begin(); itm != M.end(); ++itm) {
        ll  hes = 0;
        int h = 0;
        for (set<ll>::iterator it = itm->sc.begin(); it != itm->sc.end(); ++it)
            hes = (hes + ((*it) % mot) * r[h++]) % mot;
        N[mp(h, hes)].pb(itm->fs);
    }
    int num = 0;
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1)
            ++num;
    }
    cout << num << "\n";
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            for (int i = 0; i < itn->sc.size(); ++i)
                cout << itn->sc[i] << " ";
            cout << "\n";
        }
    }

    return 0;
}

ll he(string& t) {
    ll res = 177;
    for (int i = 0; i < t.size(); ++i)
        res = (res + (ll)(t[i] + 1) * p[i]) % mod;
    return res;
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<int>
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

ll  mod = 1000000123;
ll  mot = 1000001011;
int n;
string s;
ll  p[100300];
ll  r[100300];
map<string, set<ll> > M;
map<string, set<ll> >::iterator itm;
map<ll, vector<string> > N;
map<ll, vector<string> >::iterator itn;

ll he(string& t);

int main() {
    ios_base::sync_with_stdio(false);
    p[0] = 271;
    for (int i = 1; i < 100300; ++i)
        p[i] = (p[i - 1] * p[0]) % mod;
    r[0] = 2003;
    for (int i = 1; i < 100300; ++i)
        r[i] = (r[i - 1] * r[0]) % mot;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en + 1 < s.size() && s[en + 1] != '/')
            ++en;
        string s_ = "";
        for (int j = en + 1; j < s.length(); ++j)
            s_ += s[j];
        M[s.substr(0, en + 1)].insert(he(s_));
    }
    for (itm = M.begin(); itm != M.end(); ++itm) {
        ll  hes = 0;
        int h = 0;
        for (set<ll>::iterator it = itm->sc.begin(); it != itm->sc.end(); ++it)
            hes = (hes + ((*it) % mot) * r[h++]) % mot;
        hes = (hes + h * r[h]) % mot;
        N[hes].pb(itm->fs);
    }
    int num = 0;
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1)
            ++num;
    }
    cout << num << "\n";
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            for (int i = 0; i < itn->sc.size(); ++i)
                cout << itn->sc[i] << " ";
            cout << "\n";
        }
    }

    return 0;
}

ll he(string& t) {
    ll res = 177;
    for (int i = 0; i < t.size(); ++i)
        res = (res + (ll)(t[i] + 1) * p[i]) % mod;
    return res;
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<ll >
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

int n;
string s;
map<string, set<string> > M;
map<string, set<string> >::iterator itm;
map<vector<string>, vector<string> > N;
map<vector<string>, vector<string> >::iterator itn;

int main() {
    ios_base::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en < s.size() && s[en] != '/')
            ++en;
        M[s.substr(0, en)].insert(s.substr(en));
    }
    for (itm = M.begin(); itm != M.end(); ++itm) {
        vector<string> w;
        for (set<string>::iterator it = itm->sc.begin(); it != itm->sc.end(); ++it)
            w.pb(*it);
        N[w].pb(itm->fs);
    }
    int num = 0;
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1)
            ++num;
    }
    cout << num << "\n";
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            for (int i = 0; i < itn->sc.size(); ++i)
                cout << itn->sc[i] << " ";
            cout << "\n";
        }
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<int>
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

ll  mod = 1000000123;
ll  mot = 1000001011;
int n;
string s;
ll  p[100300];
ll  r[100300];
map<string, set<ll> > M;
map<string, set<ll> >::iterator itm;
map<pair<int, ll>, vector<string> > N;
map<pair<int, ll>, vector<string> >::iterator itn;
vector<vector<string> > ans;

ll he(string& t, int b);

int main() {
    ios_base::sync_with_stdio(false);
    p[0] = 271;
    for (int i = 1; i < 100300; ++i)
        p[i] = (p[i - 1] * p[0]) % mod;
    r[0] = 2003;
    for (int i = 1; i < 100300; ++i)
        r[i] = (r[i - 1] * r[0]) % mot;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en + 1 < s.size() && s[en + 1] != '/')
            ++en;
        M[s.substr(7, en - 6)].insert(he(s, en + 1));
    }
    for (itm = M.begin(); itm != M.end(); ++itm) {
        ll  hes = 0;
        int h = 0;
        for (set<ll>::iterator it = itm->sc.begin(); it != itm->sc.end(); ++it, ++h)
            hes = (hes + ((*it) % mot) * r[h]) % mot;
        N[mp(itm->sc.size(), hes)].pb(itm->fs);
    }
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            vector<string> w;
            for (int i = 0; i < itn->sc.size(); ++i)
                w.pb(itn->sc[i]);
            ans.pb(w);
        }
    }
    cout << ans.size() << "\n";
    for (int i = 0; i < ans.size(); ++i) {
        for (int j = 0; j < ans[i].size(); ++j)
            cout << "http://" << ans[i][j] << " ";
        cout << "\n";
    }

    return 0;
}

ll he(string& t, int b) {
    ll res = 0;
    for (int i = 0; i + b < t.size(); ++i)
        res = (res + (ll)(t[i + b]) * p[i]) % mod;
    return res;
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<int>
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

ll  mod = 1000000123;
ll  mot = 1000001011;
int n;
string s;
ll  p[30];
map<string, set<ll> > M;
map<string, set<ll> >::iterator itm;
map<pair<int, ll>, vector<string> > N;
map<pair<int, ll>, vector<string> >::iterator itn;
vector<vector<string> > ans;

ll he(string& t, int b);

int main() {
    ios_base::sync_with_stdio(false);
    p[0] = 271;
    for (int i = 1; i < 30; ++i)
        p[i] = (p[i - 1] * p[0]) % mod;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en + 1 < s.size() && s[en + 1] != '/')
            ++en;
        M[s.substr(7, en - 6)].insert(he(s, en + 1));
    }
    for (itm = M.begin(); itm != M.end(); ++itm) {
        ll  hes = 0;
        int h = 0;
        for (set<ll>::iterator it = itm->sc.begin(); it != itm->sc.end(); ++it, ++h)
            hes = (hes + ((*it) % mot) * p[h]) % mot;
        N[mp(itm->sc.size(), hes)].pb(itm->fs);
    }
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            vector<string> w;
            for (int i = 0; i < itn->sc.size(); ++i)
                w.pb(itn->sc[i]);
            ans.pb(w);
        }
    }
    cout << ans.size() << "\n";
    for (int i = 0; i < ans.size(); ++i) {
        for (int j = 0; j < ans[i].size(); ++j)
            cout << "http://" << ans[i][j] << " ";
        cout << "\n";
    }

    return 0;
}

ll he(string& t, int b) {
    ll res = 0;
    for (int i = 0; i + b < t.size(); ++i)
        res = (res + (ll)(t[i + b]) * p[i]);
    return res;
}

/*
http://abacaba.com
http://abacaba.com/test
*/


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<int>
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

ll  mod = 1000000123;
ll  mot = 1000001011;
int n;
string s;
ll  p[100300];
ll  r[100300];
map<string, set<ll> > M;
map<string, set<ll> >::iterator itm;
map<pair<int, ll>, vector<string> > N;
map<pair<int, ll>, vector<string> >::iterator itn;

ll he(string& t, int b);

int main() {
    ios_base::sync_with_stdio(false);
    p[0] = 271;
    for (int i = 1; i < 100300; ++i)
        p[i] = (p[i - 1] * p[0]) % mod;
    r[0] = 2003;
    for (int i = 1; i < 100300; ++i)
        r[i] = (r[i - 1] * r[0]) % mot;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en + 1 < s.size() && s[en + 1] != '/')
            ++en;
        M[s.substr(0, en + 1)].insert(he(s, en + 1));
    }
    for (itm = M.begin(); itm != M.end(); ++itm) {
        ll  hes = 0;
        int h = 0;
        for (set<ll>::iterator it = itm->sc.begin(); it != itm->sc.end(); ++it)
            hes = (hes + ((*it) % mot) * r[h++]) % mot;
        N[mp(itm->sc.size(), hes)].pb(itm->fs);
    }
    int num = 0;
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1)
            ++num;
    }
    cout << num << "\n";
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            for (int i = 0; i < itn->sc.size(); ++i)
                cout << itn->sc[i] << " ";
            cout << "\n";
        }
    }

    return 0;
}

ll he(string& t, int b) {
    ll res = 0;
    for (int i = 0; i + b < t.size(); ++i)
        res = (res + (ll)(t[i + b]) * p[i]) % mod;
    return res;
}


#include <bits/stdc++.h>
using namespace std;
#define fs  first
#define sc  second
#define lb  lower_bound
#define pb  push_back
#define mp  make_pair
#define ll  long long
#define vi  vector<int>
#define vvi vector<vi >
#define mit map<ll, int>::iterator
#define sit set<ll>::iterator
#define all(x) x.begin(), x.end()

ll  mod = 1000000123;
ll  mot = 1000001011;
int n;
string s;
ll  p[100300];
map<string, set<ll> > M;
map<string, set<ll> >::iterator itm;
map<pair<int, ll>, vector<string> > N;
map<pair<int, ll>, vector<string> >::iterator itn;
vector<vector<string> > ans;

ll he(string& t, int b);

int main() {
    ios_base::sync_with_stdio(false);
    p[0] = 271;
    for (int i = 1; i < 100300; ++i)
        p[i] = (p[i - 1] * p[0]) % mod;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> s;
        int en = 7;
        while (en + 1 < s.size() && s[en + 1] != '/')
            ++en;
        M[s.substr(7, en - 6)].insert(he(s, en + 1));
    }
    for (itm = M.begin(); itm != M.end(); ++itm) {
        ll  hes = 0;
        int h = 0;
        for (set<ll>::iterator it = itm->sc.begin(); it != itm->sc.end(); ++it, ++h)
            hes = (hes + ((*it) % mot) * p[h]) % mot;
        N[mp(itm->sc.size(), hes)].pb(itm->fs);
    }
    for (itn = N.begin(); itn != N.end(); ++itn) {
        if (itn->sc.size() > 1) {
            vector<string> w;
            for (int i = 0; i < itn->sc.size(); ++i)
                w.pb(itn->sc[i]);
            ans.pb(w);
        }
    }
    cout << ans.size() << "\n";
    for (int i = 0; i < ans.size(); ++i) {
        for (int j = 0; j < ans[i].size(); ++j)
            cout << "http://" << ans[i][j] << " ";
        cout << "\n";
    }

    return 0;
}

ll he(string& t, int b) {
    ll res = 0;
    for (int i = 0; i + b < t.size(); ++i)
        res = (res + (ll)(t[i + b]) * p[i]);
    return res;
}


#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
using namespace std;

#define MAX 100005

struct Node {
    vector<int> h_ids;
    map<int, int> next;
};

int n;
char url[60];
vector<string> hostnames;
map<string, int> hostname_id, path_id;
vector<int> g[MAX], ans;

int qnt_nodes;
Node trie[MAX];

void insert(int host) {
    const vector<int>& v = g[host];
    int node = 0;
    for (int i = 0; i < v.size(); i++) {
        if (trie[node].next.count(v[i]) == 0)
            trie[node].next[v[i]] = qnt_nodes++;
        node = trie[node].next[v[i]];
    }
    trie[node].h_ids.push_back(host);
}

void dfs(int node) {
    const Node& no = trie[node];
    if (no.h_ids.size() > 1)
        ans.push_back(node);
    map<int, int>::const_iterator it;
    for (it = no.next.begin(); it != no.next.end(); it++)
        dfs(it->second);
}

int main() {
    scanf("%d", &n);
    int qnt_hostnames = 0, qnt_paths = 0;
    for (int i = 0; i < n; i++) {
        scanf("%s", url);
        int sep = 7, hid, pid;
        while (url[sep] && url[sep] != '/') sep++;
        char c = url[sep];
        url[sep] = 0;
        if (hostname_id.count(url+7) == 0) {
            hostname_id[url+7] = qnt_hostnames++;
            hostnames.push_back(url+7);
        }
        hid = hostname_id[url+7];
        url[sep] = c;
        if (path_id.count(url+sep) == 0)
            path_id[url+sep] = qnt_paths++;
        pid = path_id[url+sep];
        g[hid].push_back(pid);
    }
    trie[0] = Node();
    qnt_nodes = 1;
    for (int i = 0; i < qnt_hostnames; i++) {
        sort(g[i].begin(), g[i].end());
        g[i].erase(unique(g[i].begin(), g[i].end()), g[i].end());
        insert(i);
    }
    dfs(0);
    printf("%d\n", (int) ans.size());
    for (int i = 0; i < ans.size(); i++) {
        const vector<int>& v = trie[ans[i]].h_ids;
        for (int j = 0; j < v.size(); j++)
            printf("http://%s ", hostnames[v[j]].c_str());
        puts("");
    }
}


#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
using namespace std;
string str;
int n;
string fir,sec;
inline void depart()
{
	int ll=str.length();
	for (int i=7;i<ll;i++)
	{
		if(str[i]=='/')
		{
			fir=str.substr(0,i);
			sec=str.substr(i);
			return;
		}
	}
	fir=str;
	sec="";
}
map<string,int>mpfir,mpsec;
string list[120000];
int a[120000][2],cntfir,cntsec;
vector<int>ans[120000],cnt[120000];
map<int,int>mp[120000];
int siz,res;
inline void insert(int x)
{
	int tmp=1;
	for (int i=0;i<cnt[x].size();i++)
	{
		if(mp[tmp].count(cnt[x][i])==0)
		{
			siz++;
			mp[tmp][cnt[x][i]]=siz;
		}
		tmp=mp[tmp][cnt[x][i]];
//		printf("%d %d %d\n",x,i,cnt[x][i]);
	}
//	printf("%d %d\n",x,tmp);
	ans[tmp].push_back(x);
}
set<int>cntt[120000];
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	siz=1;
	cin>>n;
	for (int i=1;i<=n;i++)
	{
		cin>>str;
		depart();
		if(mpfir.count(fir)==0)
		{
			cntfir++;
			mpfir[fir]=cntfir;
			list[cntfir]=fir;
		}
		if(mpsec.count(sec)==0)
		{
			cntsec++;
			mpsec[sec]=cntsec;
		}
		a[i][0]=mpfir[fir];
		a[i][1]=mpsec[sec];
		cntt[a[i][0]].insert(a[i][1]);
//		cout<<fir<<" ---- "<<sec<<endl;
//		cout<<a[i][0]<<' '<<a[i][1]<<endl;
	}
	for (int i=1;i<=cntfir;i++)
	{
		for (set<int>::iterator it=cntt[i].begin();it!=cntt[i].end();it++)
		{
			cnt[i].push_back((*it));
		}
		insert(i);
	}
	for (int i=1;i<=siz;i++)
	{
		if(ans[i].size()>1)res++;
	}
	cout<<res<<endl;
	for (int i=1;i<=siz;i++)
	{
		if(ans[i].size()>1)
		{
			for (int j=0;j<ans[i].size();j++)
			{
				if(j!=0)cout<<' ';
				cout<<list[ans[i][j]];
			}
			cout<<endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define L first
#define R second

const int maxn = 1e5 + 1;
map <string,int> mp;
pair <vector <string>, string> all[maxn];
vector <string> v[maxn], g[maxn];
string site[maxn];

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int m = 1;
    for (int i = 0; i < n; i++) {
        string s, host, path;
        cin >> s;
        int p = 0;
        host = "";
        while (true) {
            if (p == s.size() || (s[p] == '/' && p > 6))
                break;
            host += s[p++];
        }
        if (s[p] == '/')
            p++;
        path = "";
        while (p < s.size())
            path += s[p++];
        if (mp[host] == 0)
            mp[host] = m++;
        if (path.size() > 0)
            v[mp[host]].push_back(path);
        site[mp[host]] = host;
    }
    int k = 1;
    for (int i = 1; i < m; i++) {
        sort (v[i].begin(), v[i].end());
        v[i].resize(unique(v[i].begin(), v[i].end()) - v[i].begin());
        if (v[i].size() > 0)
            all[k].L = v[i], all[k++].R = site[i];
    }
    sort (all + 1, all + k);
    int K = 0;
    g[K].push_back(all[1].R);
    for (int i = 2; i < k; i++)
        if (all[i].L == all[i - 1].L)
            g[K].push_back(all[i].R);
        else
            g[++K].push_back(all[i].R);
    int cnt = 0;
    for (int i = 0; i <= K; i++)
        if (g[i].size() <= 1)
            cnt++;
    cout << K - cnt + 1 << endl;
    for (int i = 0; i <= K; i++)
        if (g[i].size() > 1) {
            for (int j = 0; j < g[i].size(); j++)
                cout << g[i][j] << ' ';
            cout << '\n';
        }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define L first
#define R second

const int maxn = 1e5 + 1;

map <string,int> mp;

vector <string> v[maxn], ans[maxn], ANS[maxn];

string site[maxn];

pair <string,string> all[maxn];

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int m = 1;
    for (int i = 0; i < n; i++) {
        string s, host, path;
        cin >> s;
        int p = 0;
        host = "";
        while (true) {
            if (p == s.size() || (s[p] == '/' && p > 6))
                break;
            host += s[p++];
        }
        if (s[p] == '/')
            p++;
        path = "";
        while (p < s.size())
            path += s[p++];
        if (mp[host] == 0)
            mp[host] = m++;
        v[mp[host]].push_back(path);
        site[mp[host]] = host;
    }
    for (int i = 1; i <= m; i++) {
        sort (v[i].begin(), v[i].end());
        v[i].resize(unique(v[i].begin(), v[i].end()) - v[i].begin());
        all[i].L = "";
        for (int j = 0; j < v[i].size(); j++)
            all[i].L += "*" + v[i][j];
        all[i].R = site[i];
        //cout << "@" << all[i].L << ' ' << all[i].R << endl;
    }
    sort (all + 1, all + m);
    int st = 1;
    while (st < m && all[st].L == "*")
        st++;

    int sz = 0;
    ans[sz].push_back(all[st].R);
    for (int i = st + 1; i < m; i++)
        if (all[i - 1].L == all[i].L)
            ans[sz].push_back(all[i].R);
        else
            ans[++sz].push_back(all[i].R);

    int SZ = 0;
    for (int i = 0; i <= sz; i++)
        if (ans[i].size() > 1) {
            for (int j = 0; j < ans[i].size(); j++)
                ANS[SZ].push_back(ans[i][j]);
            SZ++;
        }
    cout << SZ << '\n';
    for (int i = 0; i < SZ; i++) {
        for (int j = 0; j < ANS[i].size(); j++)
            cout << ANS[i][j] << ' ';
        cout << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define L first
#define R second

const int maxn = 1e5 + 1;
map <string,int> mp;
pair <vector <string>, string> all[maxn];
vector <string> v[maxn], g[maxn];
string site[maxn];

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int m = 1;
    for (int i = 0; i < n; i++) {
        string s, host, path;
        cin >> s;
        int p = 0;
        host = "";
        while (true) {
            if (p == s.size() || (s[p] == '/' && p > 6))
                break;
            host += s[p++];
        }
        path = "";
        while (p < s.size())
            path += s[p++];
        if (mp[host] == 0)
            mp[host] = m++;
        v[mp[host]].push_back(path);
        site[mp[host]] = host;
    }
    int k = 1;
    for (int i = 1; i < m; i++) {
        sort (v[i].begin(), v[i].end());
        v[i].resize(unique(v[i].begin(), v[i].end()) - v[i].begin());
        if (v[i].size() > 0)
            all[k].L = v[i], all[k++].R = site[i];
    }
    sort (all + 1, all + k);
    int K = 0;
    g[K].push_back(all[1].R);
    for (int i = 2; i < k; i++)
        if (all[i].L == all[i - 1].L)
            g[K].push_back(all[i].R);
        else
            g[++K].push_back(all[i].R);
    int cnt = 0;
    for (int i = 0; i <= K; i++)
        if (g[i].size() <= 1)
            cnt++;
    cout << K - cnt + 1 << endl;
    for (int i = 0; i <= K; i++)
        if (g[i].size() > 1) {
            for (int j = 0; j < g[i].size(); j++)
                cout << g[i][j] << ' ';
            cout << '\n';
        }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define L first
#define R second

const int maxn = 1e5 + 1;

map <string,int> mp;

vector <string> v[maxn], ans[maxn], ANS[maxn];

string site[maxn];

pair <string,string> all[maxn];

int main() {
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    int m = 1;
    for (int i = 0; i < n; i++) {
        string s, host, path;
        cin >> s;
        int p = 0;
        host = "";
        while (true) {
            if (p == s.size() || (s[p] == '/' && p > 6))
                break;
            host += s[p++];
        }
        if (s[p] == '/')
            p++;
        path = "";
        while (p < s.size())
            path += s[p++];
        if (mp[host] == 0)
            mp[host] = m++;
        v[mp[host]].push_back(path);
        site[mp[host]] = host;
    }
    for (int i = 1; i <= m; i++) {
        sort (v[i].begin(), v[i].end());
        v[i].resize(unique(v[i].begin(), v[i].end()) - v[i].begin());
        all[i].L = "";
        for (int j = 0; j < v[i].size(); j++)
            all[i].L += "*" + v[i][j];
        all[i].R = site[i];
        //cout << "@" << all[i].L << ' ' << all[i].R << endl;
    }
    sort (all + 1, all + m + 1);
    int st = 1;
    while (st < m && all[st].L == "*")
        st++;

    int sz = 0;
    ans[sz].push_back(all[st].R);
    for (int i = st + 1; i < m; i++)
        if (all[i - 1].L == all[i].L)
            ans[sz].push_back(all[i].R);
        else
            ans[++sz].push_back(all[i].R);

    int SZ = 0;
    for (int i = 0; i <= sz; i++)
        if (ans[i].size() > 1) {
            for (int j = 0; j < ans[i].size(); j++)
                ANS[SZ].push_back(ans[i][j]);
            SZ++;
        }
    cout << SZ << '\n';
    for (int i = 0; i < SZ; i++) {
        for (int j = 0; j < ANS[i].size(); j++)
            cout << ANS[i][j] << ' ';
        cout << '\n';
    }
    return 0;
}


// In the Name of God
# include <bits/stdc++.h>

using namespace std;

typedef long double LD;
typedef long long int LL;
typedef pair <int,int> pii;

# define PB push_back
# define MP make_pair
# define L first
# define R second

const int maxn = 1e5 + 100;

string s[maxn];

vector <int> ans[maxn];

map <string, string> mp;

bool cmp(string A,string B){
	return (mp[A] < mp[B]);
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> s[i];
	sort(s, s + n);
	n = unique(s, s + n) - s;

	vector <string> v;
	for (int i = 0; i < n; i++){
		int st = -1;
		string host = "";
		for (int j = 7; j < s[i].size(); j++){
			if(s[i][j] == '/'){
				st = j;
				break;
			}
			host += s[i][j];
		}

		string path = "-";
		if(st != -1){
			for (int j = st; j < s[i].size(); j++)
				path += s[i][j];
		}
		mp[host] += path;
		if(v.size() == 0 || v.back() != host)
			v.push_back(host);
	}
	sort(v.begin(), v.end(), cmp);

	int cnt = 0;
	for (int i = 0; i < v.size(); i++){
		if(i > 0 &&  mp[v[i]] != mp[v[i - 1]])
			ans[++cnt].push_back(i);
		else
			ans[cnt].push_back(i);
	}
	int ign = 0;
	for (int i = 0; i <= cnt; i++)
		if(ans[i].size() <= 1)
			ign++;

	cout << cnt - ign + 1 << '\n';
	for (int i = 0; i <= cnt; i++){
		if(ans[i].size() <= 1)
			continue;
		for (int j = 0; j < ans[i].size(); j++){
			int indx = ans[i][j];
			cout << "http://" << v[indx] << " ";
		}
		cout << '\n';
	}

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 129
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,string>mm;
vector<unsigned long long>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(unsigned long long t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            q.push_back(tmp);
        }
        sort(q.begin(),q.end());
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            int id = getId(tmp);
            qe[id].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 233
using namespace std;

set<unsigned long long>ss;
map<string,vector<string> >qe ;
map<string,string>mm;
vector<string>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(const string& t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        qe.clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            qe[iter->second].push_back(iter->first);
        }
        int cnt = 0 ;
        for(map<string,vector<string> >::iterator it = qe.begin() ; it != qe.end(); it++)
        {
            if(it->second.size() > 1) cnt++;
        }
        cout << cnt << endl;
        for(map<string,vector<string> >::iterator it = qe.begin() ; it != qe.end(); it++)
        {
            if(it->second.size() > 1)
            {
                vector<string>q = it->second ;
                for( size_t i = 0  ; i < q.size(); i++)
                {
                    if(i!=0)cout << " ";
                    cout << q[i] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 233
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,string>mm;
vector<unsigned long long>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(unsigned long long t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            q.push_back(tmp);
        }
        sort(q.begin(),q.end());
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            int id = getId(tmp);
            qe[id].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 233
using namespace std;

set<unsigned long long>ss;
map<string,vector<string> >qe ;
map<string,string>mm;
vector<string>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(const string& t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        qe.clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + "*" + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            qe[iter->second].push_back(iter->first);
        }
        int cnt = 0 ;
        for(map<string,vector<string> >::iterator it = qe.begin() ; it != qe.end(); it++)
        {
            if(it->second.size() > 1) cnt++;
        }
        cout << cnt << endl;
        for(map<string,vector<string> >::iterator it = qe.begin() ; it != qe.end(); it++)
        {
            if(it->second.size() > 1)
            {
                vector<string>q = it->second ;
                for( size_t i = 0  ; i < q.size(); i++)
                {
                    if(i!=0)cout << " ";
                    cout << q[i] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 233
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,string>mm;
vector<unsigned long long>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(unsigned long long t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + "*" + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            q.push_back(tmp);
        }
        sort(q.begin(),q.end());
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            int id = getId(tmp);
            qe[id].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 233
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,string>mm;
vector<unsigned long long>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(unsigned long long t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            str2 += "*";
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            q.push_back(tmp);
        }
        sort(q.begin(),q.end());
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            int id = getId(tmp);
            qe[id].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 137
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,string>mm;
vector<unsigned long long>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(unsigned long long t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            q.push_back(tmp);
        }
        sort(q.begin(),q.end());
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            int id = getId(tmp);
            qe[id].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 37
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,string>mm;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}
/*
void insert(string str1,string str2)
{
    int id = get(str2);
    for(size_t i = 0 ; i < qe[id].size() ; i++)if(qe[id][i] == str1) return;
    qe[id].push_back(str1);
}
*/
void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
          //  cout << iter->second << " -- " << iter->first << endl;
            qe[tmp%maxn].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 37
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,string>mm;
vector<unsigned long long>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}
/*
void insert(string str1,string str2)
{
    int id = get(str2);
    for(size_t i = 0 ; i < qe[id].size() ; i++)if(qe[id][i] == str1) return;
    qe[id].push_back(str1);
}
*/
void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(unsigned long long t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + str2;
            }
        }
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            q.push_back(tmp);
        }
        sort(q.begin(),q.end());
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            unsigned long long tmp = get(iter->second);
            int id = getId(tmp);
            qe[id].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 233
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,vector<u64> >mm;
vector<unsigned long long>q;
string e[maxn];

unsigned long long get(const string& str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(const string& str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(unsigned long long t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            mm[str1].push_back(get(str2));
        }
        for(map<string,vector<u64> >::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            vector<u64>& vv  = iter->second;
            u64 tmp = 0;
            for(size_t i = 0 ; i < vv.size(); i++)
            {
                tmp = tmp*YY + 2 ;
                tmp += vv[i];
            }
            q.push_back(tmp);
        }
        sort(q.begin(),q.end());
        for(map<string,vector<u64> >::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            vector<u64>& vv  = iter->second;
            u64 tmp = 0;
            for(size_t i = 0 ; i < vv.size(); i++)
            {
                tmp = tmp*YY + 2 ;
                tmp += vv[i];
            }
            int id = getId(tmp);
            qe[id].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 233
using namespace std;

set<unsigned long long>ss;
vector<string>qe[maxn];
map<string,string>mm;
vector<string>q;
string e[maxn];

unsigned long long get(string str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(string str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(const string& t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        for(size_t i = 0 ; i < maxn ; i++)qe[i].clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            if(mm.find(str1) == mm.end())
            {
                mm[str1] = str2;
            }
            else
            {
                mm[str1] = mm[str1] + str2;
            }
        }
        set<string>ca;
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
          //  unsigned long long tmp = get(iter->second);
            if(ca.find(iter->second) == ca.end())q.push_back(iter->second),ca.insert(iter->second);
        }
        sort(q.begin(),q.end());
        for(map<string,string>::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
           // unsigned long long tmp = get(iter->second);
            int id = getId(iter->second);
            //cout << id << " " << iter->second << endl;
            qe[id].push_back(iter->first);
        }
        int cnt = 0 ;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( i = 0 ;  i < maxn ;i++)
        {
            if(qe[i].size() >= 2)
            {
                for(j = 0  ; j < qe[i].size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << qe[i][j] ;
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include <sstream>
#include<algorithm>
#include<cstring>
#include<set>
#include<cmath>
#include<queue>
#include<map>
#define maxn 200010
#define eps 1e-6
#define LL long long
#define u64 unsigned long long
#define YY 233
using namespace std;

set<unsigned long long>ss;
map<vector<u64>,vector<string> >qe ;
map<string,vector<u64> >mm;
vector<unsigned long long>q;
string e[maxn];

unsigned long long get(const string& str)
{
    unsigned long long tmp = 0 ;
    for(size_t i = 0 ; i < str.size(); i++)
    {
        tmp = (tmp+str[i]);
        tmp *= YY ;
    }
    return tmp ;
}

void split(const string& str, string& str1, string& str2)
{
    size_t i ;
    int cnt = 0 ;
    for( i = 0 ; i < str.size() ;i++)
    {
        if(str[i] == '/')cnt++ ;
        if(cnt == 3) break;
    }
    str1 = str.substr(0,i);
    if(i == str.size()) str2 = "233333";
    else str2 = str.substr(i,str.size()-i);
}

int getId(unsigned long long t)
{
    int l = 0 , r = q.size()-1,mid;
    while( l <= r)
    {
        mid = (l+r)/2;
        if(q[mid] == t) return mid;
        else if(q[mid] < t) l = mid+1;
        else r = mid-1;
    }
    return 0;
}

int main()
{
    int i,j,n,m;
    LL cur ;
    while(cin >> n)
    {
        string str;
        mm.clear();
        ss.clear();
        q.clear();
        qe.clear();
        for( i = 0 ; i < n ;i++)cin >> e[i];
        sort(e,e+n);
        for(i = 0 ;  i < n ;i++)
        {
            str=e[i];
            unsigned long long tmp = get(str);
            if(ss.find(tmp) != ss.end())continue;
            ss.insert(tmp);
            string str1,str2;
            split(str,str1,str2);
            mm[str1].push_back(get(str2));
        }
        for(map<string,vector<u64> >::iterator iter = mm.begin() ; iter != mm.end() ; iter++)
        {
            vector<u64>& vv  = iter->second;
            sort(vv.begin(), vv.end());
            qe[vv].push_back(iter->first);
        }

        int cnt = 0 ;
        for( map<vector<u64>, vector<string> >::iterator iter = qe.begin() ; iter != qe.end(); iter++)
        {
            if(iter->second.size() >= 2) cnt++ ;
        }
        cout << cnt << endl;
        for( map<vector<u64>,vector<string> >::iterator iter = qe.begin() ; iter != qe.end(); iter++)
        {
            if(iter->second.size() >= 2)
            {
                for(j = 0  ; j < iter->second.size();j++)
                {
                    if(j!=0)printf(" ");
                    cout << iter->second[j];
                }
                cout << endl;
            }
        }
    }
    return 0;
}


#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <set>
#include <cmath>
#include <cstring>
#include <bitset>
#include <deque>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

#define bpc(a) __builtin_popcount(a)
#define debug(x) { cerr<<#x<<" = "<<(x)<<endl; }

const int mod = 1e9 + 7;
const int inf = 1e9;
const ll linf = 1e18;

ll powm(ll a,ll p,ll m){ll r=1 % m;while(p){if(p&1)r=r*a%m;p>>=1;a=a*a%m;}return r;}

int main()
{
    int n;
    scanf("%d", &n);
    string url;
    map<string, int> pathrename;
    map<string, set<int> > paths;
    for(int i = 0; i < n; ++i)
    {
        cin >> url;
        url = url.substr(7);
        int j = find(url.begin(), url.end(), '/') - url.begin();
        string hostname = url.substr(0, j);
        string path = url.substr(j);
        int index;
        if(pathrename.count(path) > 0)
            index = pathrename[path];
        else
            pathrename[path] = index = pathrename.size();
        paths[hostname].insert(index);
    }
    map<set<int>, vs> ans;
    for(map<string, set<int> >::iterator it = paths.begin(); it != paths.end(); ++it)
        ans[it->second].push_back(it->first);
    int cnt = 0;
    for(map<set<int>, vs>::iterator it = ans.begin(); it != ans.end(); ++it)
        cnt += it->second.size() > 1;
    printf("%d\n", cnt);
    for(map<set<int>, vs>::iterator it = ans.begin(); it != ans.end(); ++it)
        if(it->second.size() > 1)
        {
            for(int i = 0; i < it->second.size(); ++i)
                cout << "http://" << it->second[i] << " ";
            puts("");
        }
    return 0;
}


#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <numeric>

using namespace std;

#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define SIZEOF(a) (sizeof(a)/sizeof((a)[0]))

typedef long long ll;

const int MAX_N = 1e6+10;
ll a[MAX_N];
int res;

const int BUFSIZE = MAX_N;
char buf[BUFSIZE + 1];
char host[30];
char path[30];
string nextString() {
	scanf("%s", buf); return buf;
}

int main()
{
	int n; cin >> n;
	map<string, set<string> > host2paths;
	FOR(i,n){
		scanf("%s", buf);
		int j = 7;
		int k = 0;
		while(buf[j] && buf[j] != '/'){
			host[k++] = buf[j++];
		}
		host[k] = 0;
		int m = 0;
		//if(buf[j]=='/') ++j;
		while(buf[j]){
			path[m++] = buf[j++];
		}
		path[m] = 0;

		string h(host), p(path);
		//cout << "h(" << h << ") > p(" << p << ")" << endl;
		host2paths[h].insert(p);
	}
	map<set<string>, set<string> > paths2hosts;
	for(map<string, set<string> >::const_iterator it = host2paths.begin();
		it != host2paths.end();
		++it)
	{
		paths2hosts[it->second].insert(it->first);
	}

	vector<set<string> > v;
	for(map<set<string>, set<string> >::const_iterator it = paths2hosts.begin();
		it != paths2hosts.end();
		++it)
	{
		const set<string>& paths = it->first;
		if(paths.size() < 1)
			continue;
		const set<string>& hosts = it->second;
		if(hosts.size() < 2)
			continue;
		v.push_back(hosts);
	}
	cout << v.size() << endl;
	FOR(i,v.size()){
		const set<string>& hosts = v[i];
		for(set<string>::const_iterator it = hosts.begin(); it != hosts.end(); ++it)
		{
			cout << "http://" << *it << " ";
		}
		cout << endl;
	}
	return 0;
}


#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <numeric>

using namespace std;

#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define SIZEOF(a) (sizeof(a)/sizeof((a)[0]))

typedef long long ll;

const int MAX_N = 1e6+10;
ll a[MAX_N];
int res;

const int BUFSIZE = MAX_N;
char buf[BUFSIZE + 1];
char host[30];
char path[30];
string nextString() {
	scanf("%s", buf); return buf;
}

int main()
{
	int n; cin >> n;
	map<string, set<string> > host2paths;
	FOR(i,n){
		scanf("%s", buf);
		int j = 7;
		int k = 0;
		while(buf[j] && buf[j] != '/'){
			host[k++] = buf[j++];
		}
		host[k] = 0;
		int m = 0;
		if(buf[j]=='/') ++j;
		while(buf[j]){
			path[m++] = buf[j++];
		}
		path[m] = 0;

		string h(host), p(path);
		//cout << h << " > " << p << endl;
		host2paths[h].insert(p);
	}
	map<set<string>, set<string> > paths2hosts;
	for(map<string, set<string> >::const_iterator it = host2paths.begin();
		it != host2paths.end();
		++it)
	{
		paths2hosts[it->second].insert(it->first);
	}

	vector<set<string> > v;
	for(map<set<string>, set<string> >::const_iterator it = paths2hosts.begin();
		it != paths2hosts.end();
		++it)
	{
		const set<string>& paths = it->first;
		if(paths.size() < 2)
			continue;
		const set<string>& hosts = it->second;
		if(hosts.size() < 2)
			continue;
		v.push_back(hosts);
	}
	cout << v.size() << endl;
	FOR(i,v.size()){
		const set<string>& hosts = v[i];
		for(set<string>::const_iterator i = hosts.begin(); i != hosts.end(); ++i)
		{
			cout << "http://" << *i << " ";
		}
		cout << endl;
	}
	return 0;
}


#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <numeric>

using namespace std;

#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define SIZEOF(a) (sizeof(a)/sizeof((a)[0]))

typedef long long ll;

const int MAX_N = 1e6+10;
ll a[MAX_N];
int res;

const int BUFSIZE = MAX_N;
char buf[BUFSIZE + 1];
char host[30];
char path[30];
string nextString() {
	scanf("%s", buf); return buf;
}

int main()
{
	int n; cin >> n;
	map<string, set<string> > host2paths;
	FOR(i,n){
		scanf("%s", buf);
		int j = 7;
		int k = 0;
		while(buf[j] && buf[j] != '/'){
			host[k++] = buf[j++];
		}
		host[k] = 0;
		int m = 0;
		//if(buf[j]=='/') ++j;
		while(buf[j]){
			path[m++] = buf[j++];
		}
		path[m] = 0;

		string h(host), p(path);
		//cout << h << " > " << p << endl;
		host2paths[h].insert(p);
	}
	map<set<string>, set<string> > paths2hosts;
	for(map<string, set<string> >::const_iterator it = host2paths.begin();
		it != host2paths.end();
		++it)
	{
		paths2hosts[it->second].insert(it->first);
	}

	vector<set<string> > v;
	for(map<set<string>, set<string> >::const_iterator it = paths2hosts.begin();
		it != paths2hosts.end();
		++it)
	{
		const set<string>& paths = it->first;
		if(paths.size() < 2)
			continue;
		const set<string>& hosts = it->second;
		if(hosts.size() < 2)
			continue;
		v.push_back(hosts);
	}
	cout << v.size() << endl;
	FOR(i,v.size()){
		const set<string>& hosts = v[i];
		for(set<string>::const_iterator i = hosts.begin(); i != hosts.end(); ++i)
		{
			cout << "http://" << *i << " ";
		}
		cout << endl;
	}
	return 0;
}


#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  1000000007
#define X    first
#define Y    second
//作者:中国江苏南京丁天行
//from CrAzYUnIoN
//I prefer being hacked than being FST
using namespace std;
int n,k;
string s,q;
pair<pair<ll,ll>,pair<ll,ll> > ha[100005];
string qwe[100005];
map<string,int> m;
pair<pair<pair<ll,ll>,pair<ll,ll> >,int> l[100005];
int ans;
set<pair<pair<ll,ll>,pair<ll,ll> > >ss[100005];
vector<pair<pair<ll,ll>,pair<ll,ll> > >vs[100005];
vector<int> res[100005];
ll cty(int w){
           ll t=12327+4293*w,ans=0;
           for(int i=0;i<q.size();i++)ans=ans*t+q[i]+23;
           return ans;
}
int get(){
    if(m.count(s)) return m[s];
    m[s]=++k;
    qwe[k]=s;
    return k;
}
pair<pair<ll,ll>,pair<ll,ll> > dtx(pair<pair<ll,ll>,pair<ll,ll> > q,pair<pair<ll,ll>,pair<ll,ll> > w){
                             q.X.X=q.X.X*orz+w.X.X;
                             q.X.Y=q.X.Y*orz+w.X.Y;
                             q.Y.X=q.Y.X*orz+w.Y.X;
                             q.Y.Y=q.Y.Y*orz+w.Y.Y;
                             return q;
}

int main()
{
    ios::sync_with_stdio(0);
    cin>>n;
    for(int i=1;i<=n;i++){
            string p;
            cin>>p;
            s="";
            q="";
            int b=0;
            for(int i=0;i<p.size();i++){
                    if(p[i]=='/')b++;
                    if(b>2)q+=p[i];
                    else s+=p[i];
            }
            int z=get();
            pair<pair<ll,ll>,pair<ll,ll> >pl=mp(mp(cty(1),cty(2)),mp(cty(3),cty(4)));
            if(b==2)pl=mp(mp(-12321,-15465),mp(-14545,-10111));

            if(!ss[z].count(pl))ss[z].insert(pl),vs[z].pb(pl);
    }
    for(int i=1;i<=k;i++)sort(vs[i].begin(),vs[i].end());
    for(int i=1;i<=k;i++)for(int j=0;j<vs[i].size();j++)ha[i]=dtx(ha[i],vs[i][j]);
    for(int i=1;i<=k;i++)l[i]=mp(ha[i],i);
    sort(l+1,l+k+1);
    for(int i=1;i<=k;i++){
            int j=i;
            while(l[j+1].first==l[j].first&&j!=k)j++;
            if(i!=j){
                     ans++;
                     for(int v=i;v<=j;v++)res[ans].pb(l[v].second);
            }
            i=j;
    }
    cout<<ans<<endl;
    for(int i=1;i<=ans;i++){
            int o=res[i].size();
            for(int j=0;j<o-1;j++)cout<<qwe[res[i][j]]<<' ';
            cout<<qwe[res[i][o-1]]<<'\n';
    }
	return 0;
}


#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>

using namespace std;

#define rep(i,a,b) for(int i = a; i < b; i++)
#define S(x) scanf("%d",&x)
#define S2(x,y) scanf("%d%d",&x,&y)
#define P(x) printf("%d\n",x)
#define all(v) v.begin(),v.end()
#define FF first
#define SS second

typedef long long int LL;
typedef pair<int, int > pii;
typedef vector<int > vi;

map<string, set<string > > M;
map<string, set<string > >::iterator it;

map<set<string >, vector<string > > ans;
map<set<string >, vector<string > >::iterator it1;

int main() {
  int n;
  S(n);
  string s;
  rep(i,0,n) {
    cin >> s;
    string host,path;
    host = ""; path = "";
    int cnt = 0;
    rep(i,0,s.size()) {
      if(s[i] == '/') cnt++;
      if(cnt > 2) {
        path += s[i];
      } else {
        host += s[i];
      }
    }
    M[host].insert(path);
  }

  for(it = M.begin(); it != M.end(); it++) {
    ans[it->SS].push_back(it->FF);
  }
  int cnt = 0;
  for(it1 = ans.begin(); it1 != ans.end(); it1++) {
    if(it1->SS.size() > 1) cnt++;
  }
  P(cnt);
  for(it1 = ans.begin(); it1 != ans.end(); it1++) if(it1->SS.size() > 1) {
    vector<string > v = it1->SS;
    rep(i,0,v.size()) cout << v[i] << " "; printf("\n");
  }
  return 0;
}


#include <iostream>
#include <algorithm>
#include <set>
#include <string>
#include <map>
#include <vector>

using namespace std;
bool filter(string &s,string &a) {
	s =s.substr(7);
	int sl = s.find('/');
	if(sl<0)
	{
		a=s;
		s="";
		return false;
	}
	a = s.substr(0,sl);
	s = s.substr(sl+1);

	if(a.length()>0 && a.length()<=20 && a[0]!='.' && a[a.length()-1]!='.' && a.find("..")==string::npos)
		;
	else return false;
	//cout<<">"<<a<<"/"<<s<<","<<s.length()<<endl;
	if(s.length()>0 && s.length()<=20 && s[0]!='/' && s.find("//")==string::npos)
		;
	else return false;
	return true;
}
int main(int argc, char const *argv[])
{
    int N;
    cin>>N;
    map<string,set<string> > m;
    for (int i = 0; i < N; ++i)
    {
    	string s,a;
    	cin>>s;

    	if(filter(s,a)) {
  //  		cout<<">>> "<<a<<"   "<<s<<endl;
    			m[a].insert(s);

    	}
    }

    map<set<string>,set<string> > m2;
    for (std::map<string,std::set<string> >::iterator it = m.begin(); it != m.end(); ++it)
   {

   		std::set<string> &v = it->second;
    string s2 = it->first;
/**   	cout<<"_____ "<<s2<<" ______\n";
   	for (std::set<string>::iterator i = v.begin(); i != v.end(); ++i)
   	{
   		cout<<*i<<'\n';
   	}
   	cout<<endl<<endl;
/**/
  // 	if(m2.find(v)!=m2.end())
   		m2[v].insert(s2);
   /*else {
   	std::set<string> v2;
    			v2.insert(s2);
    			m2[v] = v2;
   }*/
	}
	std::vector<string> ans;
    for (std::map<set<string>,std::set<string> >::iterator it = m2.begin(); it != m2.end(); ++it)
    {
    	std::set<string> &v = it->second;

    	if(v.size()>1)
    	{
    		string anss="";
	    		for (set<string>::iterator it =v.begin(); it != v.end(); ++it)
	    	{
	    		anss+="http://"+(*it)+' ';

	    	}
	    	ans.push_back(anss);
	   	}
    }
    cout<<ans.size()<<endl;
    for (int i = 0; i < ans.size(); ++i)
    {
    	cout<<ans[i]<<endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <set>
#include <string>
#include <map>
#include <vector>

using namespace std;
bool filter(string &s,string &a) {
	s =s.substr(7);
	int sl = s.find('/');
	if(sl<0)
	{
		a=s;
		s="";
		return true;
	}
	a = s.substr(0,sl);
	s = s.substr(sl+1);

	if(a.length()>0 && a.length()<=20 && a[0]!='.' && a[a.length()-1]!='.' && a.find("..")==string::npos)
		;
	else return false;
	//cout<<">"<<a<<"/"<<s<<","<<s.length()<<endl;
	if(s.length()>0 && s.length()<=20 && s[0]!='/' && s.find("//")==string::npos)
		;
	else return false;
	return true;
}
int main(int argc, char const *argv[])
{
    int N;
    cin>>N;
    map<string,set<string> > m;
    for (int i = 0; i < N; ++i)
    {
    	string s,a;
    	cin>>s;

    	if(filter(s,a)) {
  //  		cout<<">>> "<<a<<"   "<<s<<endl;
    			m[a].insert(s);

    	}
    }

    map<set<string>,set<string> > m2;
    for (std::map<string,std::set<string> >::iterator it = m.begin(); it != m.end(); ++it)
   {

   		std::set<string> &v = it->second;
    string s2 = it->first;
/**   	cout<<"_____ "<<s2<<" ______\n";
   	for (std::set<string>::iterator i = v.begin(); i != v.end(); ++i)
   	{
   		cout<<*i<<'\n';
   	}
   	cout<<endl<<endl;
/**/
  // 	if(m2.find(v)!=m2.end())
   		m2[v].insert(s2);
   /*else {
   	std::set<string> v2;
    			v2.insert(s2);
    			m2[v] = v2;
   }*/
	}
	std::vector<string> ans;
    for (std::map<set<string>,std::set<string> >::iterator it = m2.begin(); it != m2.end(); ++it)
    {
    	std::set<string> &v = it->second;

    	if(v.size()>1)
    	{
    		string anss="";
	    		for (set<string>::iterator it =v.begin(); it != v.end(); ++it)
	    	{
	    		anss+="http://"+(*it)+' ';

	    	}
	    	ans.push_back(anss);
	   	}
    }
    cout<<ans.size()<<endl;
    for (int i = 0; i < ans.size(); ++i)
    {
    	cout<<ans[i]<<endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <set>
#include <string>
#include <map>
#include <vector>

using namespace std;
bool filter(string &s,string &a) {
	s =s.substr(7);
	int sl = s.find('/');
	if(sl<0)
	{
		a=s;
		s="";
		return true;
	}
	a = s.substr(0,sl);
	s = s.substr(sl);

	if(a.length()>0 && a.length()<=20 && a[0]!='.' && a[a.length()-1]!='.' && a.find("..")==string::npos)
		;
	else {
		//cout<<"F > "<<a<<endl;
		return false;
	}
	//cout<<">"<<a<<"/"<<s<<","<<s.length()<<endl;
	if(s.length()<=21 && s[1]!='/' && s.find("//")==string::npos)
		;
	else {
		//cout<<"FF > "<<s<<endl;
		return false;
	}
	return true;
}
int main(int argc, char const *argv[])
{
    int N;
    cin>>N;
    map<string,set<string> > m;
    for (int i = 0; i < N; ++i)
    {
    	string s,a;
    	cin>>s;

    	if(filter(s,a)) {
    	//	cout<<">>> "<<a<<"   "<<s<<endl;
    			m[a].insert(s);

    	}
    }

    map<set<string>,set<string> > m2;
    for (std::map<string,std::set<string> >::iterator it = m.begin(); it != m.end(); ++it)
   {

   		std::set<string> &v = it->second;
    string s2 = it->first;
  /** 	cout<<"_____ "<<s2<<" ______\n";
   	for (std::set<string>::iterator i = v.begin(); i != v.end(); ++i)
   	{
   		cout<<*i<<'\n';
   	}
   	cout<<endl<<endl;
/**/
  // 	if(m2.find(v)!=m2.end())
   		m2[v].insert(s2);
   /*else {
   	std::set<string> v2;
    			v2.insert(s2);
    			m2[v] = v2;
   }*/
	}
	std::vector<string> ans;
    for (std::map<set<string>,std::set<string> >::iterator it = m2.begin(); it != m2.end(); ++it)
    {
    	std::set<string> &v = it->second;

    	if(v.size()>1)
    	{
    		string anss="";
	    		for (set<string>::iterator it =v.begin(); it != v.end(); ++it)
	    	{
	    		anss+="http://"+(*it)+' ';

	    	}
	    	ans.push_back(anss);
	   	}
    }
    cout<<ans.size()<<endl;
    for (int i = 0; i < ans.size(); ++i)
    {
    	cout<<ans[i]<<endl;
    }
    return 0;
}


#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <time.h>
#include <algorithm>
#include <cmath>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back

pair<pair<string, string>, int> s[100100];

pair<string, int> S[100100];

int st[100100];

pair<int,int > k[100100];

vector<int> f[100100];

int main()
{
    ios_base::sync_with_stdio(0);
    //freopen("unequal.in", "r", stdin);
    //freopen("unequal.out", "w", stdout);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for (int i=0; i<n; i++){
        string S;
        cin >> S;
         s[i] = mp(mp("", ""), i);
        int f = 0;
        for (int j=7; j<S.length(); j++){
            char c = S[j];
            if (c == '/') f = 1;
            if (!f)
                s[i].F.F += c;
            else
                s[i].F.S += c;
        }
    }
    sort(s, s+n);
    int kl = -1;
    for (int i=0; i<n; i++){
        if (i == 0 || s[i].F.F != s[i-1].F.F)
            kl++;
        s[i].S = kl;
        st[kl] = i;
    }
    kl++;
    for (int i=0; i<kl; i++)
        S[i].S = i;
    for (int i=0; i<n; i++){
        if (i == 0 || s[i].F.F != s[i-1].F.F)
            S[s[i].S].F = s[i].F.S;
        else{
            if (s[i].F.S != s[i-1].F.S)
            S[s[i].S].F += '#' + s[i].F.S;
        }
    }
    sort(S, S+kl);
    int v = 0;
    f[v].pb(S[0].S);
    for (int i=1; i<kl; i++){
        if (S[i].F != S[i-1].F) v++;
        f[v].pb(S[i].S);
    }
    int ans=0;
    for (int i=0; i<=v; i++)
        if (f[i].size() > 1) ans++;
    cout << ans << endl;
    for (int i=0; i<=v; i++)
    if (f[i].size() > 1){
        for (int j=0; j<f[i].size(); j++){
            int to = f[i][j];
            cout << "http://" << s[st[to]].F.F << ' ';
        }
        cout << endl;
    }
    return 0;
}


//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define xx first
#define yy second
#define LL long long
#define MP make_pair
#define INF 0x3f3f3f3f
#define lson l, m, rt << 1
#define rson m + 1, r, rt << 1|1
#define CLR(a, b) memset(a, b, sizeof(a))
#define PII pair<LL,int>

using namespace std;

const int maxn=100100;

struct Node{
    string name;
    int path;
    Node(){}
    Node(string name,int path):name(name),path(path){}
    bool friend operator<(const Node &a,const Node &b){
        if(a.path==b.path) return a.name<b.name;
        return a.path<b.path;
    }
}p[maxn];
vector<string> ans[maxn],vec[maxn];
map<string,int> mp_host,mp_path;
map<string,int> ::iterator it;
int n;

int main(){
    while(scanf("%d",&n)!=EOF){
        for(int i=0;i<=n;i++) ans[i].clear(),vec[i].clear();
        mp_host.clear();mp_path.clear();
        int e=0;
        for(int i=0;i<n;i++){
            string s;cin>>s;
            string host="http://",path="";
            int st=0;
            for(int j=7;j<s.length()&&s[j]!='/';j++){
                st=j;
                host+=s[j];
            }
            for(int j=st+1;j<s.length();j++) path+=s[j];
//            cout<<host<<"-----------"<<path<<endl;
            if(mp_host.find(host)==mp_host.end()){
                mp_host[host]=++e;vec[e].push_back(path);
            }else vec[mp_host[host]].push_back(path);
        }
        for(int i=1;i<=e;i++){
            sort(vec[i].begin(),vec[i].end());
            vec[i].erase(unique(vec[i].begin(),vec[i].end()),vec[i].end());
        }
        e=0;
        int m=0;
        for(it=mp_host.begin();it!=mp_host.end();++it){
            int u=it->second,v;
            string tmp="";
            for(int i=0;i<vec[u].size();i++){
                tmp+=vec[u][i];tmp+="+";
            }
//            cout<<it->first<<"        "<<tmp<<endl;
            if(mp_path.find(tmp)==mp_path.end()) mp_path[tmp]=++e;
            v=mp_path[tmp];
            p[m++]=Node(it->first,v);
        }
        sort(p,p+m);
        for(int i=0;i<m;i++){
            ans[p[i].path].push_back(p[i].name);
//            cout<<p[i].name<<"   "<<p[i].path<<endl;
        }
        int cnt=0;
        for(int i=1;i<=e;i++) if(ans[i].size()>1){
            cnt++;
        }
        printf("%d\n",cnt);
        for(int i=1;i<=e;i++) if(ans[i].size()>1){
            for(int j=0;j<ans[i].size();j++) cout<<ans[i][j]<<" ";
            puts("");
        }
    }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	int n, cnt = 0;
	cin >> n;
	map<string, set<int> > m;
	map<string, int> who;
	for (int i = 0; i < n; i++)
	{
		string s;
		cin >> s;
		s = s.substr(7, s.size()-7);
		string host, path;
		int pos = 0;
		while (pos < s.size() and s[pos] != '/')
		{
			host.push_back(s[pos]);
			pos++;
		}
		while (pos < s.size())
		{
				path.push_back(s[pos]);
			pos++;
		}
		if (!who.count(path))
			who[path] = cnt++;
		m[host].insert(who[path]);
	}
	vector<pair<vector<int>, string> > v;
	for (map<string, set<int> >::iterator it = m.begin(); it != m.end(); it++)
	{
		string host = it->first;
		set<int>& s = it->second;
		vector<int> p;
		for (set<int> ::iterator its = s.begin(); its != s.end(); its++)
			p.push_back(*its);
		v.push_back(make_pair(p, host));
	}
	sort(v.begin(), v.end());
	vector<vector<string> > ans;
	for (int i = 1; i < v.size(); i++)
	{
		if (v[i].first == v[i-1].first)
		{
			ans.push_back(vector<string>());
			ans.back().push_back("http://" + v[i-1].second);
			while (i < v.size() and v[i].first == v[i-1].first)
			{
				ans.back().push_back(" http://" + v[i].second);
				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 << ans[i][j];
		}
		cout << '\n';
	}
	return 0;
}


#include <iostream>
#include <string>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cmath>
#include <cassert>
#include <string.h>
 using namespace std;
typedef long long ll;
#define MOD (ld)1e9 + 7
#define eps 1e-12
#define PI (ld)3.14159265358979324
#define mp make_pair
#define ft first
#define pb push_back
#define sd second
#define sz(a) a.size()
#define pii pair<int,int>
#define pld pair<long long,long long>
#define loop(i, n) for(int (i) = 0; (i) < (n) ; ++ (i))
#define forn(i, l, r) for(int (i) = (l); (i) < (r) ; ++ (i))
#define vec vector
#define str string
#define vii vector<int>
#define vld vector<ld>

/*******************************************************/

void solve() {
    ll n;
    cin >> n;
    int presz = strlen("http://");
    map<string , int> sid;
    vector<string> itos;
    vector<pair<set<string>, int> > cls;
    ll k = 0;

    loop(i,n) {
        str s;
        cin >> s;
        s = s.substr(presz);
        ll pos = s.find("/");
        string qr = "";

        if(pos != string::npos) {
            qr = s.substr(pos);
            s.resize(pos);
        }
        // cout << s << " \n" << qr <<endl;

        if(sid.find(s) != sid.end()) {
            // cerr << ".";
            cls[sid[s]].first.insert(qr);
        } else {
            // cerr << "z";
            itos.push_back(s);
            sid[s] = k;
            cls.resize(k+1);
            cls[k].first.insert(qr);
            cls[k].second = k;
            ++k;
        }
    }

    sort(cls.begin(),cls.end());

    vector<vector<int> > ans;
    int last = 0;
    ans.resize(1);
    int p = 0;
    ll count = 0;
    // cout << cls[0].first.size() << " " <<cls[1].first.size() << " " <<cls[2].first.size() << endl;
    loop(i, cls.size()) {
        if(cls[i].first == cls[last].first) {
            ans[p].push_back(cls[i].second);
            if(i - last == 1) ++count;
        } else {
            ++p;
            last = i;
            ans.push_back(vector<int> (1,cls[i].second));
        }
    }
    cout << count << endl;
    loop(i,ans.size()) {
        if(ans[i].size() <= 1) continue;
        loop(j,ans[i].size()) {
            int id = ans[i][j];
            cout << "http://" << itos[id] << " ";
        }
        cout << endl;
    }

}

int main()
{
    // freopen("in.txt","r", stdin);

    // cout << fixed;
    // cout.precision(3);

    solve();
    ios_base::sync_with_stdio(false);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m, store;
map <string, int>::iterator it;
vector <string> v[MAX];
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        if(store.find(str) != store.end()) continue;
        store[str] = 1;

        k = str.size();
        s.clear();
        t.clear();

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        t = "#";

        while(i < k)
        {
            t += str[i];
            i++;
        }

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].pb(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        sort(v[i].begin(),v[i].end());
        k = v[i].size();
        t.clear();

        FOR(j,0,k-1) t += v[i][j];

        if(t.size() == 1 && t[0] == '#') continue;
        //if(t.size() == 2 && t == "/#") continue;
        //if(t.size() == 3 && t == "#/#") continue;

        it = m.find(t);

        if(it == m.end())
        {
            ans[sz].pb(i);
            m[t] = sz++;
        }
        else
            ans[it->yy].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        FOR(j,0,k-1)
            cout << "http://" << a[ ans[i][j] ] << " ";
        cout << NL;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m;
map <string, int>::iterator it;
set <string> v[MAX];
set <string>::iterator set_it;
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        k = str.size();
        s.clear();
        t = "#";

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        while(i < k)
        {
            t += str[i];
            i++;
        }

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].insert(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        t.clear();

        for(set_it = v[i].begin(); set_it != v[i].end(); set_it++)
            t += (*set_it);

        if(t.size() == 1 && (t[0] == '#')) continue;
        //if(t.size() == 3 && t == "#/#") continue;

        it = m.find(t);

        if(it == m.end())
        {
            ans[sz].pb(i);
            m[t] = sz++;
        }
        else
            ans[it->yy].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        FOR(j,0,k-1)
            cout << "http://" << a[ ans[i][j] ] << " ";
        cout << NL;
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m, store;
map <string, int>::iterator it;
vector <string> v[MAX];
vector <int> ans[MAX];
string a[MAX];

int main()
{
    //READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        if(store.find(str) != store.end()) continue;
        store[str] = 1;

        k = str.size();
        s  = "";

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        t = "#";

        while(i < k)
        {
            t += str[i];
            i++;
        }

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].pb(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        sort(v[i].begin(),v[i].end());
        k = v[i].size();
        t = "";

        FOR(j,0,k-1) t += v[i][j];

        if(t.size() == 1 && t[0] == '#') continue;
        //if(t.size() == 2 && t == "/#") continue;
        //if(t.size() == 3 && t == "#/#") continue;

        if(m.find(t) == m.end())
            m[t] = sz++;
        ans[m[t]].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        cout << "http://" << a[ ans[i][0] ];

        FOR(j,1,k-1)
            cout << " http://" << a[ ans[i][j] ];
        cout << NL;
    }

    return 0;
}

/*

5
http://abc/
http://abc
http://abc
http://abd
http://abd/

*/


#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define NL '\n'
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define mem(a,b) memset(a,b,sizeof(a))
#define FOR(i,j,k) for(i=j;i<=k;i++)
#define REV(i,j,k) for(i=j;i>=k;i--)
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#define pi 2.0*acos(0.0)
#define MOD 1000000007
#define MAX 100005

map <string, int> m, store;
map <string, int>::iterator it;
vector <string> v[MAX];
vector <int> ans[MAX];
string a[MAX];

int main()
{
    READ("in.txt");
    //WRITE("out.txt");
    std::ios_base::sync_with_stdio(0);
    int cases, n=0, i, j, k, cnt, sum, sz;
    string str, s, t;

    cin >> cases;

    while(cases--)
    {
        cin >> str;

        if(store.find(str) != store.end()) continue;
        store[str] = 1;

        k = str.size();
        s.clear();
        t.clear();

        FOR(i,7,k-1)
        {
            if(str[i] == '/') break;
            s += str[i];
        }

        t = "#";

        while(i < k)
        {
            t += str[i];
            i++;
        }

        if(m.find(s) == m.end())
        {
            a[n] = s;
            m[s] = n++;
        }

        v[m[s]].pb(t);
    }

    m.clear();
    sz = 0;

    FOR(i,0,n-1)
    {
        sort(v[i].begin(),v[i].end());
        k = v[i].size();
        t.clear();

        FOR(j,0,k-1) t += v[i][j];

        if(t.size() == 1 && t[0] == '#') continue;
        //if(t.size() == 2 && t == "/#") continue;
        //if(t.size() == 3 && t == "#/#") continue;

        it = m.find(t);

        if(it == m.end())
        {
            ans[sz].pb(i);
            m[t] = sz++;
        }
        else
            ans[it->yy].pb(i);
    }

    cnt = 0;

    FOR(i,0,sz-1)
    {
        if(ans[i].size() > 1)
            cnt++;
    }

    cout << cnt << NL;

    FOR(i,0,sz-1)
    {
        k = ans[i].size();
        if(k < 2) continue;

        FOR(j,0,k-1)
            cout << "http://" << a[ ans[i][j] ] << " ";
        cout << NL;
    }

    return 0;
}