{"raw_statement":[{"iden":"problem statement","content":"Given an array of $N$ integers $A=(A_1,A_2,...,A_N)$, find the number of pairs $(i,j)$ of integers satisfying all of the following conditions:\n\n*   $1 \\le i < j \\le N$\n*   $A_i \\neq A_j$"},{"iden":"constraints","content":"*   All values in input are integers.\n*   $2 \\le N \\le 3 \\times 10^5$\n*   $1 \\le A_i \\le 10^9$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$"},{"iden":"sample input 1","content":"3\n1 7 1"},{"iden":"sample output 1","content":"2\n\nIn this input, we have $A=(1,7,1)$.\n\n*   For the pair $(1,2)$, $A_1 \\neq A_2$.\n*   For the pair $(1,3)$, $A_1 = A_3$.\n*   For the pair $(2,3)$, $A_2 \\neq A_3$."},{"iden":"sample input 2","content":"10\n1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000"},{"iden":"sample output 2","content":"45"},{"iden":"sample input 3","content":"20\n7 8 1 1 4 9 9 6 8 2 4 1 1 9 5 5 5 3 6 4"},{"iden":"sample output 3","content":"173"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}