declare var require: any; let lines: string[] = require("fs").readFileSync("/dev/stdin", "utf8").split("\n"); const [N] = lines[0].split(' ').map(Number); const S = lines.slice(1, N + 1); const ans = new Set(S.map((s1) => S.map((s2) => s1 + s2))).size; console.log(ans);