#include <iostream>

using namespace std;

int main()
{
    int n, k, zbir = 0;
    cin >> n >> k;
    int a[n];
    for(int i = 0; i < n; i++){
        cin >> a[i];
        zbir += a[i];}

    if(k == 0)
        cout << zbir;
    return 0;
}