{"raw_statement":[{"iden":"problem statement","content":"You are given a sequence of length $N$: $A=(A_1,A_2,\\ldots,A_N)$.  \nFind the number of triples $(i,j,k)$ that satisfy both of the following conditions.\n\n*   $1\\leq i \\lt j \\lt k \\leq N$\n*   $A_i$, $A_j$, and $A_k$ are distinct."},{"iden":"constraints","content":"*   $3 \\leq N \\leq 2\\times 10^5$\n*   $1 \\leq A_i \\leq 2\\times 10^5$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$"},{"iden":"sample input 1","content":"4\n3 1 4 1"},{"iden":"sample output 1","content":"2\n\nThe two triples $(i,j,k)$ satisfying the conditions are $(1,2,3)$ and $(1,3,4)$."},{"iden":"sample input 2","content":"10\n99999 99998 99997 99996 99995 99994 99993 99992 99991 99990"},{"iden":"sample output 2","content":"120"},{"iden":"sample input 3","content":"15\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9"},{"iden":"sample output 3","content":"355"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}