#include<iostream>
#include<math.h>
using namespace std;
int main(int argc, char *argv[]){
int sonNum;
cin>>sonNum;
int exponent;
cin>>exponent;
int sum=0;
for(int i=0; i<sonNum; i++){
int potential;
cin>>potential;
int potentialEx=pow(1.0*potential, exponent);
if(potentialEx>0){
sum+=potentialEx;
}
}
cout<<sum<<endl;
return 0;
}
#include<math.h>
using namespace std;
int main(int argc, char *argv[]){
int sonNum;
cin>>sonNum;
int exponent;
cin>>exponent;
int sum=0;
for(int i=0; i<sonNum; i++){
int potential;
cin>>potential;
int potentialEx=pow(1.0*potential, exponent);
if(potentialEx>0){
sum+=potentialEx;
}
}
cout<<sum<<endl;
return 0;
}