CF835B.The number on the board

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Some natural number was written on the board. Its sum of digits was not less than kk . But you were distracted a bit, and someone changed this number to nn , 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.

输入格式

The first line contains integer kk ( 1<=k<=1091<=k<=10^{9} ).

The second line contains integer nn ( 1<=n<10^{100000} ).

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

输出格式

Print the minimum number of digits in which the initial number and nn can differ.

输入输出样例

  • 输入#1

    3
    11
    

    输出#1

    1
    
  • 输入#2

    3
    99
    

    输出#2

    0
    

说明/提示

In the first example, the initial number could be 1212 .

In the second example the sum of the digits of nn is not less than kk . The initial number could be equal to nn .

首页