Black Jack
题号:NC237151
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

PaiGuDragon participated in the game of fake-blackjack.

Each card is written with a number from 1 to 10. In the game, the PaiGuDragon can choose "shoot" or "stay".

If selecting "shoot",  PaiGuDragon will draw the card at the top of the stack.
 
If selecting "stay",  PaiGuDragon will end draw and count the sum of points.

If the total number of cards drawn exceeds 21, then PaiGuDragon lose everything!

On the premise that the sum of points is less than or equal to 21, the greater the sum of points, the stronger the card power.

As a clairvoyant, PaiGuDragon can see every card in the stack from top to bottom. So how many cards will the smart PaiGuDragon choose to draw to get the best result?

输入描述:


The first line contains an interger - the number of cards.
The second line contains n intergers - card points from top to bottom, each number is an interger between 1 and 10.

输出描述:

Print a single integer, the number of cards PaiGuDragon will draw.
示例1

输入

复制
3
10 9 3

输出

复制
2

说明

In the first test case, PaiGuDragon will draw 2 cards and get 10 + 9 = 19 points. If it draws 3 cards, the sum will exceed 21.
示例2

输入

复制
6
1 2 3 4 5 6

输出

复制
6

说明

In the second test case, PaiGuDragon will draw all cards, and get 1 + 2 + 3 + 4 +5 + 6 = 21 points!