{"raw_statement":[{"iden":"problem statement","content":"For a positive integer $x$, let $f(x)$ denote the sum of its digits. For instance, we have $f(153) = 1 + 5 + 3 = 9$, $f(2023) = 2 + 0 + 2 + 3 = 7$, and $f(1) = 1$.\nYou are given a sequence of positive integers $A = (A_1, \\ldots, A_N)$. Find the minimum possible value of $\\sum_{i=1}^N f(A_i + x)$ where $x$ is a non-negative integer."},{"iden":"constraints","content":"*   $1\\leq N\\leq 2\\times 10^5$\n*   $1\\leq A_i < 10^9$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $\\ldots$ $A_N$"},{"iden":"sample input 1","content":"4\n4 13 8 6"},{"iden":"sample output 1","content":"14\n\nFor instance, $x = 7$ makes $\\sum_{i=1}^N f(A_i+x) = f(11) + f(20) + f(15) + f(13) = 14$."},{"iden":"sample input 2","content":"4\n123 45 678 90"},{"iden":"sample output 2","content":"34\n\nFor instance, $x = 22$ makes $\\sum_{i=1}^N f(A_i+x) = f(145) + f(67) + f(700) + f(112) = 34$."},{"iden":"sample input 3","content":"3\n1 10 100"},{"iden":"sample output 3","content":"3\n\nFor instance, $x = 0$ makes $\\sum_{i=1}^N f(A_i+x) = f(1) + f(10) + f(100) = 3$."},{"iden":"sample input 4","content":"1\n153153153"},{"iden":"sample output 4","content":"1\n\nFor instance, $x = 9999846846847$ makes $\\sum_{i=1}^N f(A_i+x) = f(10000000000000) = 1$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}