#include #include using namespace std; int inf=100000000; using ll=long long; using pint=pair; using pll=pair; using pque_int=priority_queue; #define rep(i,n) for (int i=0; i < (int) n; i++) #define _GLIBCXX_DEBUG template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } int VecMax(vector &v) { int output=-inf; rep(i,v.size()) chmax(output,v[i]); return output; } int VecMin(vector &v) { ll output=inf; rep(i,v.size()) chmin(output,v[i]); return output; } ll VecSum(vector &v) { ll output=0; rep(i,v.size()) output+=v[i]; return output; } ll pow(ll a,ll n) { ll output=1; while (n>0) output*=a; return output; } int dir(char c) { if (c=='L') return 3; else if (c=='R') return 1; else if (c=='U') return 2; else return 0; } int main() { int N; cin >> N; vector s; rep(i,N) cin >> s[i]; set t; rep(i,N) { rep(j,N) { string ns=s[i]+s[j]; t.insert(ns); } } cout << t.size() << endl; }