P13637 [CodeChef] integ
普及
题目描述

Chef has an array of N integers. He wants to play a special game. In this game he needs to make all the integers in the array greater than or equal to 0.
Chef can use two types of operations. The first type is to increase all the integers of the given array by 1, but it costs X coins. The operation of the second type is to add 1 to only one integer of the given array and to use this operation you need to pay 1 coin. You need to calculate the minimal cost to win this game (to make all integers greater than or equal to 0)

Input
The first line of the input contains an integer N denoting the number of elements in the given array. The second line contains N space-separated integers A1, A2, ..., AN denoting the given array. The third line contains number X - cost of the first type operation.

Output
For each test case, output a single line containing minimal cost required to make all the integers greater than or equal to zero.

Constraints

1 ≤ N ≤ 10^5
-10^9 ≤ Ai ≤ 10^9
0 ≤ X ≤ 10^9

Example
Input:
3
-1 -2 -3
2

Output:
5

Explanation
Example case 1: Use the first type operation twice and the second type once.

输入格式

见题面

输出格式

见题面

样例输入
3 -1 -2 -3 2
样例输出
5