Find the maximum weight of gold that can be carried in a knapsack with a capacity of , if gold bars are given with specified weights.
The first line contains one number — the knapsack capacity. Then given non-negative integers, not exceeding — the weights of bars.
Print the maximum weight of gold that can be carried in the knapsack.