Problem1834--00接竹竿

1834: 00接竹竿

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

有很多数字卡片,每张卡片上是数字0 到9中的一个数。
从1 开始拼出正整数,每拼一个,就保存起来,卡片就不能用来拼其它数了。
例如,当有30 张卡片,其中0 到9 各3 张,则可以拼出1 到10,但是拼11 时卡片1 已经只有一张了,不够拼出11。

Input

整数n(n<=2022),代表卡片0 到9 各n张。

Output

输出一个整数,代表能从1 拼到这个整数。

Sample Input Copy

30

Sample Output Copy

10

Source/Category

admin