Codeforces Round 427 (Div. 2)
B
The number on the board
Codeforces
1100
原题
← AC →
翻译中…

Some natural number was written on the board. Its sum of digits was not less than $*k*$. But you were distracted a bit, and someone changed this number to $*n*$, replacing some digits with others. It's known that the length of the number didn't change.

翻译中…

You have to find the minimum number of digits in which these two numbers can differ.

翻译中…

Input

翻译中…

The first line contains integer $*k*$ ($1 ≤ *k* ≤ 10^{9}$).

翻译中…

The second line contains integer $*n*$ ($1 ≤ *n* < 10^{100000}$).

翻译中…

There are no leading zeros in $*n*$. It's guaranteed that this situation is possible.

翻译中…

Output

翻译中…

Print the minimum number of digits in which the initial number and $*n*$ can differ.

翻译中…

Note

翻译中…

In the first example, the initial number could be $12$.

翻译中…

In the second example the sum of the digits of $*n*$ is not less than $*k*$. The initial number could be equal to $*n*$.

翻译中…

样例

Input #1
3
11
Output #1
1
InputCopy OutputCopy
Input #2
3
99
Output #2
0
InputCopy OutputCopy
题目信息
题号
835B
时间限制
2 s
内存限制
256 MB
标签
贪心

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。