What joy! Petya's parents went on a business trip for the whole year and the playful kid is left all by himself. Petya got absolutely happy. He jumped on the bed and threw pillows all day long, until... 

Today Petya opened the cupboard and found a scary note there. His parents had left him with duties: he should water their favourite flower all year, each day, in the morning, in the afternoon and in the evening. "Wait a second!" — thought Petya. He know for a fact that if he fulfills the parents' task in the *i*-th (1 ≤ *i* ≤ 12) month of the year, then the flower will grow by *a*<sub class="lower-index">*i*</sub> centimeters, and if he doesn't water the flower in the *i*-th month, then the flower won't grow this month. Petya also knows that try as he might, his parents won't believe that he has been watering the flower if it grows strictly less than by *k* centimeters. 

Help Petya choose the minimum number of months when he will water the flower, given that the flower should grow no less than by *k* centimeters.
The first line contains exactly one integer *k* (0 ≤ *k* ≤ 100). The next line contains twelve space-separated integers: the *i*-th (1 ≤ *i* ≤ 12) number in the line represents *a*<sub class="lower-index">*i*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 100).
5
1 1 1 1 2 2 3 2 2 1 1 1
2
0
0 0 0 0 0 0 0 1 1 2 3 0
0
11
1 1 4 1 1 5 1 1 4 1 1 1
3
15
20 1 1 1 1 2 2 1 2 2 1 1
1
7
8 9 100 12 14 17 21 10 11 100 23 10
1
52
1 12 3 11 4 5 10 6 9 7 8 2
6
50
2 2 3 4 5 4 4 5 7 3 2 7
-1
0
55 81 28 48 99 20 67 95 6 19 10 93
0
93
85 40 93 66 92 43 61 3 64 51 90 21
1
99
36 34 22 0 0 0 52 12 0 0 33 47
2
99
28 32 31 0 10 35 11 18 0 0 32 28
3
99
19 17 0 1 18 11 29 9 29 22 0 8
4
76
2 16 11 10 12 0 20 4 4 14 11 14
5
41
2 1 7 7 4 2 4 4 9 3 10 0
6
47
8 2 2 4 3 1 9 4 2 7 7 8
7
58
6 11 7 0 5 6 3 9 4 9 5 1
8
32
5 2 4 1 5 0 5 1 4 3 0 3
9
31
6 1 0 4 4 5 1 0 5 3 2 0
9
35
2 3 0 0 6 3 3 4 3 5 0 6
9
41
3 1 3 4 3 6 6 1 4 4 0 6
11
97
0 5 3 12 10 16 22 8 21 17 21 10
5
100
21 21 0 0 4 13 0 26 0 0 0 15
6
100
0 0 16 5 22 0 5 0 25 0 14 13
7
97
17 0 10 0 0 0 18 0 14 23 15 0
6
100
0 9 0 18 7 0 0 14 33 3 0 16
7
95
5 2 13 0 15 18 17 0 6 11 0 8
9
94
11 13 0 9 15 8 8 16 3 7 1 3
11
96
8 4 12 15 8 0 4 10 6 6 12 11
11
100
5 5 3 8 6 5 0 3 3 8 1 3
-1
100
1 0 0 1 1 0 1 1 1 1 2 1
-1
100
6 3 2 0 4 1 2 2 2 2 1 1
-1
0
0 0 0 0 0 0 0 0 0 0 0 0
0
100
0 0 0 0 0 0 0 0 0 0 0 0
-1
0
100 100 100 100 100 100 100 100 100 100 100 100
0
100
100 100 100 100 100 100 100 100 100 100 100 100
1
12
1 1 1 1 1 1 1 1 1 1 1 1
12
13
1 1 1 1 1 1 1 1 1 1 1 2
12
15
10 1 1 1 1 1 1 1 1 1 1 1
6
1
0 0 0 0 0 0 0 0 0 0 0 0
-1
k = int(input())

a = list(map(int, input().split()))

a.sort(reverse=True)

sumGrow = 0
count = 0
for i in range(len(a)):
    if sumGrow >= k:
        break
    else:
        sumGrow += a[i]
        count+=1

print(count)