#include<iostream>
#include<unordered_set>
#include<unordered_map>
#include<vector>
unsigned int a[1000001000];
int main(){
std::ios_base::sync_with_stdio(0);std::cin.tie(NULL);
unsigned int n,k;
std::cin>>n>>k;
unsigned int d[500100];
for(size_t i=0;i<n;i++){std::cin>>d[i];}
unsigned long long res=n*k;
if(1<k) res-=(k*(k-1))/2;
/*
if(n==k){std::cout<<res;return 0;}
unsigned long long count=0;
for(size_t i=0;i<k+1;i++){
if(!a[d[i]]){count++;}
}
for(size_t i=0;i<n-k;i++){
if(!a[d[i]]){}
}
*/
std::cout<<res;
}