Once Bob got to a sale of old TV sets. There were n TV sets at that sale. TV set with index i costs ai bellars. Some TV sets have a negative price — their owners are ready to pay Bob if he buys their useless apparatus. Bob can «buy» any TV sets he wants. Though he's very strong, Bob can carry at most m TV sets, and he has no desire to go to the sale for the second time. Please, help Bob find out the maximum sum of money that he can earn.

Input

The first line contains two space-separated integers n and m (1 ≤ m ≤ n ≤ 100) — amount of TV sets at the sale, and amount of TV sets that Bob can carry. The following line contains n space-separated integers ai ( - 1000 ≤ ai ≤ 1000) — prices of the TV sets. 

Output

Output the only number — the maximum sum of money that Bob can earn, given that he can carry at most m TV sets.

Examples

Input

5 3
-6 0 35 -2 4


Output

8


Input

4 2
7 0 0 -7


Output

7
// solve a fuckin easy problem using 2D segment tree..that's nice AJ....
import java.io.*;
import java.util.*;
public final class buy_tv
{
	static Scanner sc=new Scanner(System.in);
	static PrintWriter out=new PrintWriter(System.out);
	static Node[] tree,a;
	
	static void build(int node,int l,int r)
	{
		if(l>r)
		{
			return;
		}
		if(l==r)
		{
			tree[node].idx=a[l].idx;
			tree[node].val=a[l].val;
		}
		else
		{
			int mid=((l+r)>>1);
			build(node<<1,l,mid);
			build((node<<1)|1,mid+1,r);
			if(tree[node<<1].val<tree[node<<1|1].val)
			{
				tree[node]=tree[node<<1];
			}
			else
			{
				tree[node]=tree[node<<1|1];
			}
		}
	}
	
	static Node query(int node,int s,int e,int l,int r)
	{
		if(s>e || l>e || r<s)
		{
			return null;
		}
		if(l<=s && r>=e)
		{
			return tree[node];
		}
		else
		{
			int mid=(s+e)>>1;
			Node q1=query(node<<1,s,mid,l,r);
			Node q2=query(node<<1|1,mid+1,e,l,r);
			if(q1.val<q2.val)
			{
				return q1;
			}
			else
			{
				return q2;
			}
		}
	}
	
	static void update(int node,int s,int e,int l,int r,long val)
	{
		if(s>e || l>e || r<s)
		{
			return;
		}
		if(s==e)
		{
			tree[node].val=val;
		}
		else
		{
			int mid=(s+e)>>1;
			update(node<<1,s,mid,l,r,val);
			update(node<<1|1,mid+1,e,l,r,val);
			if(tree[node<<1].val<tree[node<<1|1].val)
			{
				tree[node]=tree[node<<1];
			}
			else
			{
				tree[node]=tree[node<<1|1];
			}
		}
	}
	
	public static void main(String args[]) throws Exception
	{
		int n=sc.nextInt(),m=sc.nextInt();
		a=new Node[n];tree=new Node[4*n];
		for(int i=0;i<tree.length;i++)
		{
			tree[i]=new Node(-1,Long.MAX_VALUE);
		}
		for(int i=0;i<n;i++)
		{
			a[i]=new Node(i,sc.nextInt());
		}
		build(1,0,n-1);
		long sum=0;
		while(m>0)
		{
			Node curr=query(1,0,n-1,0,n-1);
			if(curr.val>=0)
			{
				break;
			}
			else
			{
				//out.println(curr.val);
				sum+=Math.abs(curr.val);
				update(1,0,n-1,curr.idx,curr.idx,Long.MAX_VALUE);
			}
			m--;
		}
		out.println(sum);
		out.close();
	}
}
class Node
{
	int idx;
	long val;
	public Node(int idx,long val)
	{
		this.idx=idx;
		this.val=val;
	}
}