#!/usr/bin/env python3 # This is just completely broken: I think it ignores overlaps smaller than the # complete prefix. n = int(input()) ps = [input().split("/")[1:] for _ in range(n)] ps.sort() total_components = sum(len(p) for p in ps) def cp(a, b): i = 0 while i < len(a) and i < len(b) and a[i] == b[i]: i += 1 return i max_l = 0 cnt = 0 def test(idx): global max_l, cnt p = ps[idx][:-1] counts = [0] * 1000000 for q in ps: counts[cp(p, q)] += 1 s = 0 for l in range(1000000 - 1, -1, -1): s += counts[l] if 2 * s >= n and l > max_l and l <= len(p): max_l = l cnt = s break test(n // 2) if n % 2 == 0: test(n // 2 - 1) print(total_components - max_l * (2 * cnt - n))