#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 10000007
#define mod 1000000007
#define mp make_pair
#define sd(n) scanf("%lld",&n)
#define pb push_back
#define FIO() freopen("in.txt","r",stdin)
#define F first
#define S second
#define db double
#define INF 1e12
#define pd(n) printf("%lld\n",n)
#define pdd(n) printf("%.20lf\n",n)
#define pii pair<ll,ll>

int main()
{
    //FIO();
   ll n,k;
   ll ans=0;
   cin>>n>>k;
   ll sum=0;
   while(n--)
   {
    cin>>x;
    sum+=max(0LL,x);
   }
   cout<<sum<<endl;

    

    
}