{"problem":{"name":"Exact Payment","description":{"content":"The currency used in Takahashi Kingdom is _Myon_. There are $1$\\-, $10$\\-, $100$\\-, $1000$\\- and $10000$\\-Myon coins, and so forth. Formally, there are $10^n$\\-Myon coins for any non-negative integer ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"codefestival_2016_ex_b"},"statements":[{"statement_type":"Markdown","content":"The currency used in Takahashi Kingdom is _Myon_. There are $1$\\-, $10$\\-, $100$\\-, $1000$\\- and $10000$\\-Myon coins, and so forth. Formally, there are $10^n$\\-Myon coins for any non-negative integer $n$.\nThere are $N$ items being sold at Ex Store. The price of the $i$\\-th $(1≦i≦N)$ item is $A_i$ Myon.\nTakahashi is going to buy some, at least one, possibly all, of these $N$ items. He hates receiving change, so he wants to bring coins to the store so that he can pay the total price without receiving change, no matter what items he chooses to buy. Also, since coins are heavy, he wants to bring as few coins as possible.\nFind the minimum number of coins he must bring to the store. It can be assumed that he has an infinite supply of coins.\n\n## Constraints\n\n*   $1≦N≦20,000$\n*   $1≦A_i≦10^{12}$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $...$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"codefestival_2016_ex_b","tags":[],"sample_group":[["3\n43 24 37","16\n\nThere are seven possible total prices: $24, 37, 43, 61, 67, 80,$ and $104$. With seven $1$\\-Myon coins, eight $10$\\-Myon coins and one $100$\\-Myon coin, Takahashi can pay any of these without receiving change."],["5\n49735011221 970534221705 411566391637 760836201000 563515091165","105"]],"created_at":"2026-03-03 11:01:14"}}