{"raw_statement":[{"iden":"problem statement","content":"You are given an integer sequence of length $N$: $A=(A_1,A_2,\\cdots,A_N)$.\nFind the number of pairs of integers $(i,j)$ ($1 \\leq i < j \\leq N$) such that calculation of $A_i+A_j$ by column addition does not involve carrying."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 10^6$\n*   $0 \\leq A_i \\leq 10^6-1$\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$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"4\n4 8 12 90"},{"iden":"sample output 1","content":"3\n\nThe pairs $(i,j)$ that count are $(1,3),(1,4),(2,4)$.\nFor example, calculation of $A_1+A_3=4+12$ does not involve carrying, so $(i,j)=(1,3)$ counts. On the other hand, calculation of $A_3+A_4=12+90$ involves carrying, so $(i,j)=(3,4)$ does not count."},{"iden":"sample input 2","content":"20\n313923 246114 271842 371982 284858 10674 532090 593483 185123 364245 665161 241644 604914 645577 410849 387586 732231 952593 249651 36908"},{"iden":"sample output 2","content":"6"},{"iden":"sample input 3","content":"5\n1 1 1 1 1"},{"iden":"sample output 3","content":"10"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}