#include <bits/stdc++.h>
using namespace std;
/*
*/
const int maxn=1e4;
int a[maxn];
int main()
{   int m,n,k;
    while(~scanf("%d%d%d",&m,&n,&k)){
          for(int i=0;i<m;i++){
              scanf("%d",&a[i]);
          }
          for(int i=m-n;i<m;i++){
              a[i]=min(a[i],k);
          }
          int ans=0;
          for(int i=0;i<m;i++)
             ans+=a[i];
          printf("%d",ans);

    }
    return 0;
}

#include <bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{

    ll n,k,x;
    cin>>n>>k>>x;

    ll ans = 0;
    for(int i = n; i >= 1; i--){

        ll el;cin>>el;
        if(i <= k){
            ans+=x;
        }else{

            ans+=el;
        }

    }

    cout<<ans<<endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define long long long
#define INF (long) 1e18
#define MOD 998'244'353
#define pll pair<long, long>
#define pb push_back
#define FOR(i, a, b) \
    for (long i = a; i < (long) b; i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(v, atr) \
    sort(v.begin(), v.end(), \
      [](auto &a, auto &b) { return a.atr < b.atr; });
#define UNSORT(v, atr) \
    sort(v.begin(), v.end(), \
      [](auto &a, auto &b) { return a.atr > b.atr; });
#define PRINTV(v) \
    if (not v.empty()) { \
        printf("%lld", v[0]); \
        for (long _i = 1; _i < (long) v.size(); _i++) \
            printf(" %lld", v[_i]); \
        printf("\n"); \
    }

auto gera_primos(long n)
{
  set<long> primos;
  vector<bool> crivo(n);
  primos.insert(1);
  primos.insert(2);
  for (long i = 3; i < n; i += 2) {
    if (crivo[i]) continue;
    primos.insert(i);
    for (long j = i; j < n; j += i) {
      crivo[j] = true;
    }
  }
  return primos;
}

long fat(long k, long a=1)
{
  long x = 1;
  FOR (i, a, k+1) {
    x = (x * i);
  }
  return x;
}

int main()
{
  long n, k, x;
  cin >> n >> k >> x;

  vector<long> a(n);
  for (auto &x : a) {
    cin >> x;
  }
  long total = 0;
  FOR (i, 0, n-k) {
    total += a[i];
  }
  total += min(n, k) * x;
  printf("%lld\n", total);

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,x,t,sum=0,ar[100];
    cin>>n>>x>>t;
    for(int i=0;i<n;i++)
    {
        cin>>ar[i];
        }

    for(int y=0;y<n-x;y++)
    sum += ar[y];

    sum = sum+ t*x;
    cout<<sum;
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<queue>
#include<stack>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<stdlib.h>
#include<cmath>
#include<string>
#include<algorithm>
#include<iostream>
#include <functional>         // greater ��� ���� �ʿ�
using namespace std;

int main()
{
	long long n, k, x;
	cin >> n >> k >> x;

	vector<int> arr(n);
	for (int i = 0; i < n; i++)
		cin >> arr[i];

	sort(arr.begin(), arr.end(), greater<int>());

	for (int i = 0; i < k; i++) {
		arr[i] = x;
	}

	int sol = 0;
	for (int i = 0; i < n; i++)
		sol += arr[i];

	cout << sol<< endl;
	return 0;
}

#include <iostream>

int main() {
	int n, k, x;

	std::cin >> n >> k >> x;

	int out = x*k;
	int temp;
	for (int i = 0; i < n-k; ++i)	{
		std::cin >> temp;
		out += temp;
	}

	std::cout << out;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int n, k, x, j, sum;

int main()
{
    cin >> n >> k >> x;
    for (int i = 0 ; i < n ; i ++)
    {
        cin >> j;
        if (i < n - k) sum += j;
    }
    sum += k * x;
    cout << sum;
}

#include<stdio.h>
int main()
{
	int i,j,k,l,n,m,s=0,a[1000];
	scanf("%d%d%d",&k,&l,&n);
	for(i=0;i<k;i++){
		scanf("%d",&a[i]);
	}
	l=k-l;
	for(i=0;i<k;i++){
		if(i<l)
		s=s+a[i];
		else
		s=s+n;
	}
	printf("%d",s);
	return 0;
}

#include <bits/stdc++.h>
#define pb push_back
#define sz(x) x.size()
#define F first
#define S second
#define mp make_pair
#define ll long long
#define sqr(x) ((x)*(x))
#define inf 1e18
using namespace std;
    ll a[2000010], d[2000010];
    ll b[200010], c[1010][1010];
    ll mn=inf, mx=-inf, ans, cnt, sm=1, n, m, cur;
    bool ok, okk, u[1000010], uu[310][310], uk[1000010];
    char ck[510][510], ch[100010];
    int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
    vector < ll > g[900010], an[100];

int main(){

    //freopen ("input.txt","r",stdin); freopen ("output.txt","w",stdout);

    std::ios::sync_with_stdio(false);

    ll k, x;
    cin>>n>>k>>x;
    for(int i=0;i<n;i++){
    	cin>>a[i];
    }
    sort(a, a+n);
    for(int i=0;i<n-k;i++){
    	ans+=a[i];
    }
    ans+=k*x;
    cout<<ans;

    return 0;
}

#include <iostream>

using namespace std;

int main()
{
	int *arr;
	int size;

	int k, x, sum = 0;
	cin >> size >> k >> x;

	if (size <= 0) {
		cerr << "Invalid size" << endl;
		return 1;
	}

	arr = new int[size];

	for (int i = 0; i < size; i++) {

		cin >> arr[i];
	}

	int temp; // временная переменная для обмена элементов местами

			  // Сортировка массива пузырьком
	for (int i = 0; i < size - 1; i++) {
		for (int j = 0; j < size - i - 1; j++) {
			if (arr[j] > arr[j + 1]) {
				// меняем элементы местами
				temp = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = temp;
			}
		}
	}

	for (int i = size - k; i < size; i++) {
		arr[i] = x;
	}
		for (int i = 0; i < size; i++) {
		sum = sum + arr[i];
	}
	cout << sum;

	delete[] arr; // освобождение памят

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,k,x;
int ans=0;
int main(){
	scanf("%d%d%d",&n,&k,&x);
	for(int i=1;i<=n-k;i++){
		int in;
		scanf("%d",&in);
		ans+=in;
	}
	ans+=k*x;
	printf("%d\n",ans);
	exit(0);
}

#include<iostream>
using namespace std;

int main()
{
	int n,k,x,ans=0;
	cin>>n>>k>>x;
	for(int i=n; i>=1; i--)
	{
		int num;
		cin>>num;
		if(i<=k)
			ans+=x;
		else
			ans+=num;
	}
	cout<<ans;
	return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define ld double
#define lc char
#define li int
#define ls string
#define v_p push_back
#define r_0  ; return 0  ;
#define sq ; sqrt ;
using namespace std ;
const long long  N=2e5+7 ;
const long long  M=1e9+7 ;
const long long  H=1e5+7 ;
const long long  B=1e4+7 ;
const long long  A=1e6+7 ;
map <ll , ll> mp , pm ;
deque <ll> v , vc , ve ;
deque <char> p , pe ;
deque <string> ts , ss ;
deque <double> sd ;
ll a , b , c , d , e ,  cnt , ans , r , n , l,R,k ,x;
ld q , t , cnt1;
string g , h , w , o , z , m , s ;
char y , u ;
bool re , rt ;
set < ll > st ;
vector <ll> vec(N)   ;
vector< pair < ll , ll > >  rp;
main ()
{
    cin >> n  >> a >> b  ;
cnt =0 ;
 ll ar[n] ;
    for (ll i=1 ; i <=n ; i ++ )
        cin >> ar[i] ;

    cnt=a*b ;
    for (ll i=1 ; i <=n-a; i ++ ){
        cnt+=ar[i] ;
    }
    cout << cnt ;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
     int n,k,x,temp,sum=0;
     cin>>n>>k>>x;
     vector<int>ch;
     for(int i=0; i<n; i++)
     {
          cin>>temp;
          ch.push_back(temp);
          if(i<n-k) sum =sum+ch[i];
     }
    sum=sum+k*x;
    cout<<sum;
}

/*  */
 #include <iostream>
 #include<algorithm>
 #define MAXN 100010

 int N, K, X, sol = 0;
 int A[MAXN];

 main(void){
    //freopen("a.in", "r", stdin);

    scanf("%d%d%d", &N, &K, &X);
    for(int i=1; i<=N; i++)
        scanf("%d", &A[i]);

    for(int i=1; i<=N-K; i++)
        sol += A[i];

    printf("%d\n", sol + K*X);

    return 0;
}

//Chores
//http://codeforces.com/problemset/problem/873/A

#include <iostream>

using namespace std;

int main()
{
    int n, k, x, ttime=0;
    cin >> n >> k >> x;
    int a[n+1];
    for (int i =0 ; i <= n-k-1; i++)
    {
        cin >> a[i];
        ttime += a[i];
    }
    ttime += k *x;
    cout << ttime << endl;
    return 0;
}

//Chores
//http://codeforces.com/problemset/problem/873/A

#include <iostream>

using namespace std;

int main()
{
    int n, k, x, ttime=0,a;
    cin >> n >> k >> x;

    for (int i =0 ; i <= n-k-1; i++)
    {
        cin >> a;
        ttime += a;
    }
    cout << ttime + k * x<< endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){

	int n, k, x, time=0, element;

	cin >> n >> k >> x;

	for(int i=0;i<(n-k);i++){
		cin >> element;
		time+=element;
	}

	for(int i=0;i<k;i++){
		cin >> element;
	}

	time = time + (x*k);

	cout << time << endl;

}

#include<iostream>
using namespace std;
int main ()
{
	int n,k,x,sum(0);
	cin>>n>>k>>x;
	for(int i=0;i<n;i++)
	{
		int y;
		cin>>y;
		if(i>=n-k)
			sum+=x;
		else
			sum+=y;
	}
	cout<<sum<<endl;
	return 0;
}

#include <vector>
#include <cstdio>

void check(bool q) {
	if (!q) {
		throw 1;
	}
}

bool is_x_less_than_all_a(const int x, const std::vector<int> & a) {
	for (auto& it : a) {
		if (x >= it) {
			return false;
		}
	}
	return true;
}

int main() {
//	freopen("input.txt", "rt", stdin);

	int n, k, x;
	scanf("%d %d %d", &n, &k, &x);

	std::vector<int> a(n);
	for (auto& it : a) {
		scanf("%d", &it);
	}

	check(is_x_less_than_all_a(x, a));

	int time = 0;
	int i = n-1;
	while (k > 0 && i >= 0) {
		time += x;
		--k;
		--i;
	}

	while (i >= 0) {
		time += a[i];
		--i;
	}

	printf("%d", time);

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,x;
	cin>>n>>k>>x;
	int arr[n];
	int val=0;
	int q=0;
	for(int i=0; i<n; i++){
		cin>>arr[i];
	}
	sort(arr, arr+n, greater<int>());
	for(int i=0; i<k; i++){
		val=val+x;
	}
    for(int i=k; i<n; i++){
		val=val+arr[i];
	}
	cout<<val<<endl;
	return 0;
}

#include<iostream>
using namespace std;

int main() {
    int n, k, x, ans = 0;

    cin >> n >> k >> x;

    for(int i = 0; i < n; i++) {
        int a;

        cin >> a;

        if(i >= n - k) {
            ans += x;
        } else {
            ans += a;
        }
    }

    cout << ans << endl;

    return 0;
}

#include <vector>
#include <algorithm>
#include <cstdio>

int main() {
    int n, k, x;
    scanf("%d %d %d", &n, &k, &x);

    std::vector<int> a(n);

    for (auto& it : a) {
        scanf("%d", &it);
    }

    printf("%d", std::accumulate(a.begin(), a.begin()+n-k, x*k));

    return 0;
}

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,k,x,a,i;
    cin>>n>>k>>x;
    x = k*x;
    for(i=0; i<n-k; i++){
    cin>>a;
    x += a;
    }
    cout<<x;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ldbl;
typedef pair<int, int> pii;
typedef pair<unsigned, unsigned> puu;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef vector<int> vi;
typedef vector<unsigned> vu;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pii> vpii;
typedef vector<puu> vpuu;
typedef vector<pll> vpll;
typedef vector<pull> vpull;
typedef vector<string> vstr;
typedef vector<double> vdbl;
typedef vector<ldbl> vldbl;
#define pb push_back
#define ppb pop_back
#define pfr push_front
#define ppfr pop_front
#define emp emplace
#define empb emplace_back
#define be begin
#define rbe rbegin
#define all(x) (x).be(), (x).end()
#define rall(x) (x).rbe(), (x).rend()
#define fst first
#define fir first
#define sec second
#define mkp make_pair
#define brif(cond) if (cond) break
#define ctif(cond) if (cond) continue
#define retif(cond) if (cond) return
static inline void canhazfast() {ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);}
template<typename T> T gcd(T a, T b) {return b == 0 ? a : gcd(b, a%b);}
template<typename T> T extgcd(T a, T b, T &x, T &y)
{
    T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
    while (b) {
        T q = a/b; a %= b; swap(a, b);
        x0 -= q*x1; swap(x0, x1);
        y0 -= q*y1; swap(y0, y1);
    }
    x = x0; y = y0; return a;
}
static inline int ctz(unsigned x) {return __builtin_ctz(x);}
static inline int ctzll(ull x) {return __builtin_ctzll(x);}
static inline int clz(unsigned x) {return __builtin_clz(x);}
static inline int clzll(ull x) {return __builtin_clzll(x);}
static inline int popcnt(unsigned x) {return __builtin_popcount(x);}
static inline int popcntll(ull x) {return __builtin_popcountll(x);}
static inline int bsr(unsigned x) {return 31^clz(x);}
static inline int bsrll(ull x) {return 63^clzll(x);}

int main()
{
    canhazfast();

    int n, k, x, a, ans = 0;

    cin >> n >> k >> x;
    for (int i = 0; i < n-k; ++i) cin >> a, ans += a;
    ans += k*x;
    cout << ans;

    return 0;
}

#include <iostream>
#include <vector>
using namespace std;
#define forn(i, n) for(int i = 0; i < int(n); i++)
int main() {
	int n, k, x;
	cin >> n >> k >> x;
	int ans = k * x;
	forn(i, n - k) {
		int x;
		cin >> x;
		ans += x;
	}
	cout << ans;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, k, x, ans = 0;
	cin >> n >> k >> x;
	while (n--) {
		int a;
		cin >> a;
		ans += (n < k? x: a);
	}
	cout << ans;
	return 0;
}

#include <iostream>

using namespace std;

int n, k, x, sum = 0;
int chores[100];

int main()
{
    cin >> n >> k >> x;

    for(int i = 0; i < n; ++i)
        cin >> chores[i];

    for(int i = n - k; i < n; ++i)
        chores[i] = x;

    for(int i = 0; i < n; ++i)
        sum += chores[i];

    cout << sum;

    return 0;
}

#include <iostream>
#include <vector>
using namespace std;

int main() {
	int n, k, x;
	cin >> n >> k >> x;
	vector<int>a(n + 1, 0);
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	int i = 1;
	int ans = 0;
	while (i <= n - k) {
		ans += a[i];
		i++;
	}
	ans += k*x;
	cout << ans;
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
#define IO ios::sync_with_stdio(false); cin.tie(0);
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
const int INF = (int) 1e9;
const ll LINF = (ll) 1e18;
const int nmax = 110;
int n, k, x;
int a[nmax];
int main() {
    IO;
    #ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		//freopen("output.txt", "w", stdout);
	#endif
    cin >> n >> k >> x;
    int res = 0;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n - k; i++)
        res += a[i];
    for (int i = n - k + 1; i <= n; i++)
        res += min(a[i], x);
    cout << res;
    return 0;
}

#include <iostream>
using namespace std;

int main()
{
    int n, k, x;
    cin >> n >> k >> x;
    int sum = 0;
    for (int i = 1; i <= n; i++)
    {
        int y;
        cin >> y;
        if (i <= n - k) sum += y;
        else sum += x;
    }
    cout << sum;
}

#include <iostream>

using namespace std;
int main()
{
	int y , a , b , sum=0;
	cin >> y >> a >> b;
	int *x = new int[y];
	for (int i = 0; i < y; i++)
	{
		cin >> x[i];
	}
	for (int i = y-1; i > y-a-1; i--)
	{
		x[i] = b;
	}
	for (int i = 0; i < y; i++)
	{
		sum += x[i];
	}
	cout << sum;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long

int main()
{
	ll n, k, x, i, total = 0;
	ll a[101];

	cin>>n>>k>>x;

	for(i = 0; i < n; i++)
	{
		cin>>a[i];
	}

	for(i = n - 1; i >= 0; i--)
	{
		if(k && a[i] > x)
		{
			k--;
			total += x;
		}
		else
		{
			total += a[i];
		}
	}

	cout<<total<<endl;

	return 0;
}

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a,b;
	int time=0;
	cin>>a>>b;
	int arr[n];
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	for(int j=1;j<=a;j++){
		time+=b;
	}
	for(int k=0;k<n-a;k++){
		time+=arr[k];
	}
	cout<<time<<endl;

}

#include<iostream>
#include<math.h>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int n,i,a[101],k,x,t=0,ik;
	cin>>n>>k>>x;
	for(i=1;i<=n;i++){
		cin>>a[i];
	}
	ik=(n-k)+1;
	for(i=1;i<ik;i++){
		t=t+a[i];
	}
	t=t+(k*x);
	cout<<t;
}

#include<iostream>
using namespace std;
int main() {
  int n ,k, x, b, ans1 = 0,ans0 = 0;
  cin >> n >> k >> x;
  for (int i = 0; i <  n - k; i++) {
    b = 0;
    cin >> b;
    ans1 += b;
  }
  for (int i = 0; i < k; i++) {
    b = 0;
    cin >> b;
    ans0 += b;
  }
  if (ans0 < x * k) {
    cout << ans1 + ans0;
  }
  else {
    cout << ans1 + (k * x);
  }

  return 0;
}

#include<iostream>
#include<cmath>
#include<cstring>
#include<conio.h>
#include<iomanip>
using namespace std;
int main() {
	int arr[1000], num, task,time,sum = 0;
	cin >> num >> task >> time;
	for (int i = 0; i < num; i++) {
		cin >> arr[i];
	}
	for (int i = 0; i < num; i++) {
		for (int g = i; g < num; g++) {
			if (arr[g] < arr[i]) {
				int temp = arr[i];
				arr[i] = arr[g];
				arr[g] = temp;
			}
		}
	}
	for (int i = num-1; i >=(num-task); i--) {
		arr[i] = time;
	}
	for (int i = 0; i < num; i++) {
		sum += arr[i];
	}
	cout << sum << endl;
	return 0;

}

#include<iostream>

using namespace std;

int n,k,x,y,ans;

int main()
{
	cin>>n>>k>>x;

	for(int i=n;i>=1;i--)
	{
		cin>>y;
		if(i<=k)  ans+=x;
		else  ans+=y;
	}

	cout<<ans<<endl;

	return 0;
}

#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
int main()
{
     int n,k,x,ans=0;
     cin>>n>>k>>x;
     for(int i=n;i>=1;i--)
     {
          int num;
          cin>>num;
          if(i<=k)
            ans+=x;
          else
            ans+=num;
     }
     cout<<ans<<endl;
     return 0;
}

#include <bits/stdc++.h>
#define a first
#define b second
#define oo 100000007
typedef long long ll;
using namespace std;
const int N = 105;
int n , k , x ,t, ans;
int main()
{

    //freopen("in.txt","r" ,stdin);
    //freopen("output.txt" ,"w",stdout);
    ios::sync_with_stdio(false);

    cin >> n >> k >> x ;
    ans = k * x ;
    for(int i = 0 ; i < n - k ; ++i){
        cin >> t ;
        ans += t ;
    }
    cout << ans << endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const int SIZE = 2e2 + 5;

int main(){
	int n, k, x, t, a[SIZE];

	t = 0;

	cin >> n >> k >> x;

	for(int i = 0; i < n; i++)
		cin >> a[i];

	for(int i = n - 1; i >= 0; i--){
		if(k) t += min(x, a[i]), k--;
		else t += a[i];
	}

	cout << t << endl;

	return 0;
}

#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <sstream>

using namespace std;
int main()
{
	int n, k, x;
	cin >> n >> k >> x;

	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		if (i < n - k)
			sum += a;
		else
			sum += x;
	}

	cout << sum;
	return 0;
}

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
// 1 2 3 4 5 6 7 8 9
// k=3; x = 8
int main()
{
	int n, k, x, A[101],sum(0);
	cin >> n >> k >> x;
	for (int i = 0; i < n; i++) cin >> A[i];

	for (int i = 0; i < n - k; i++) sum += A[i];
	for (int i = n - k; i < n; i++)
	{
		//if (A[i]>x)
			sum += x;
		//else sum += A[i];
	}
	cout << sum << endl;
	return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int n,k,x,i,s=0;
    cin>>n>>k>>x;
    int a[n];
    for(i=0; i<n; i++)
       cin>>a[i];
     n=n-k;

    for(i=0; i<n; i++){
        s+=a[i];
    }
    s=s+(k*x);

    cout<<s<<endl;

    return 0;
}

#include <iostream>
using namespace std;
int main ()
{
    long long n,i,t,a[1001],k,x,s=0,j;
    cin>>n>>k>>x;
    for(i=1;i<=n;i++)
    cin>>a[i];
    for(i=1;i<n;i++)
    for(j=i+1;j<=n;j++)
    if(a[i]<a[j])
    {t=a[i]; a[i]=a[j]; a[j]=t;}
    for(i=1;i<=k;i++)
    {if(a[i]>=x)
    s+=x;
    else s+=a[i];}
    for(i=k+1;i<=n;i++)
    s+=a[i];
    cout<<s;
    //system ("pause");
    return 0;
}

#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,x,k,sum=0;
cin>>n>>k>>x;
int arr[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
for(int i=n-1;i>=0;i--)
{
  if(k==0){
    break;
   }
  arr[i]=x;
   k--;

}
for(int i=0;i<n;i++)
    sum+=arr[i];
cout<<sum;
    return 0;
}

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	int a[100];
	int n,k,x;
	cin>>n>>k>>x;
	int high =n-1;
	int sum =0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];

	}
	sort(a,a+n);
	while(k>0)
	{
		a[high]=x;
		k--;
		high--;
	}
	for(int i=0;i<n;i++)
	{
		sum=sum+a[i];

	}
	cout<<sum<<endl;
}

#include <iostream>
#include<algorithm>
#include<string>
#include<set>
using namespace std;
int main()
{
	int n, k, x;
	cin >> n >> k >> x;
	int z;
	int sum = 0;
	for (int i = 1; i <= n; i++)
	{
		cin >> z;
		if (i < n - k + 1)
			sum += z;
		else
			sum += x;
	}
	cout << sum;

	return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>

using namespace std;

int main(){
  int n, k, x, sum=0;
  cin>>n>>k>>x;
  vector<int> time(n);
  vector<int>::iterator it;
  for(int i=0;i<n;i++){
    cin>>time[i];
  }
  for(int i=0;i<k;i++){
    it=max_element(time.begin(),time.end());
    if(x<*it){
      *it=x;
    }
  }
  for(int i=0;i<time.size();i++){
    sum+=time[i];
  }
  cout<<sum<<endl;
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

long long a[200001];
stack <int> s;
long long l[200001];
long long r[200001];
long long ans;

int main () {
	long long n, k , x;
	cin >> n >> k >> x;
	for (int i = 1;i <= n;i ++) {
		cin >> a[i];
		if (i > n - k) {
			ans += min (a[i], x);
		}
		else ans += a[i];
	}
	cout << ans;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define int long long

const int MAXN = 2e5 + 10;
const int INF = 1e9;

signed main() {

	int n, k, x;
	cin >> n >> k >> x;

	vector<int> a(n);
	for (int i = 0; i < n; ++i)
		cin >> a[n - i - 1];

	int sum = 0;

	for (int i = 0; i < n; ++i) {
		if (a[i] > x && k) {
			k--;
			sum += x;
		} else {
			sum += a[i];
		}
	}

	cout << sum;

	return 0;
}

#include<stdio.h>
void main()
{
	int n, k, x, cnt=0, i, a[101], max=0;
	scanf("%d%d%d", &n, &k, &x);
	for(i=0; i<n; i++)
	scanf("%d", &a[i]);
	while(k>0)
	{
	for(i=0; i<n; i++)
	if(a[i]>max)
		max=a[i];
	for(i=0; i<n; i++)
		if(a[i]==max)
		{
		cnt=cnt+x;
		a[i]=0;
		break;
		}
	max=0;
	k--;
	}
	for(i=0; i<n; i++)
	if(a[i]!=0)
	cnt=cnt+a[i];
	printf("%d", cnt);
}

#include <iostream>
using namespace std;
int main(){
	int n,k,x,a,sum=0;
	cin>>n>>k>>x;
	for(int i=0; i<n-k; i++){
		cin>>a;
		sum+=a;}
	cout<<sum+k*x;
	return 0;
}

#include<iostream>
#include<algorithm>
#include<map>
#include<string>
#include<vector>
using namespace std;
#define fo(a,b) for(int i = a;i<b;i++)
#define ll long long
#define N 101

int main()
{
	int n, k, x, ans = 0, a;
	cin >> n >> k >> x;
	for (int i = 1; i <= n-k; i++)
	{
		cin >> a;
		ans += a;
	}
	cout << ans + x * k;
	//system("pause");
}

#include <iostream>
#include <math.h>
#include <cctype>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdlib.h>
#include <list>
#include <fstream>

#define forn for(int i=0;i<n;i++)

using namespace std;

int main()
{
	int n, k, x, a;
	cin >> n >> k >> x;
	int s = k*x;
	forn
	{
		cin >> a;
		if (i < n - k) s += a;
	}
	cout << s;
	//system("pause");
	return 0;
}

#include <iostream>
using namespace std;
int main() {
	int number, can_do, time,sum=0;
	cin >> number >> can_do >> time;
	sum = can_do * time;
	for (int c = 0; c < number - can_do; c++) {
		cin >> time;
		sum += time;
	}
	cout << sum;
}

#include <bits/stdc++.h>

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(0); std::cout.tie(0); std::cerr.tie(0);

    int n, res, k, x;
    std::cin >> n >> k >> x;
    res = 0;
    if (k>=n) {
        res = x*n;
    } else {
        res = x*k;
        for(int i=0; i<n-k; i++) {
            std::cin >> x;
            res += x;
        }
    }
    std::cout << res;
}

#include<iostream>
#include<string>
#include<algorithm>
#include<numeric>
using namespace std;
int main(){
	int  n,k,x,*a,sum=0;
	cin>>n>>k>>x;
	a=new int[n];
	for(int i=0;i<n;i++)
		cin>>a[i];
	sum=accumulate(a,a+n-k,sum);
	sum+=k*x;
	cout<<sum;
}

// In The Name Of God

/*   ki oomade?!   */

#include <bits/stdc++.h>

using namespace std;

int n, k, x, ans;
const int N = 1e2 + 10;
int a[N];

void display()
{
	for(int i = 0; i < n; i ++) cout << a[i] << ' ';

	cout << endl;
}
int main(){
	cin >> n >> k >> x;

	for(int i = 0; i < n; i ++) cin >> a[i];

	reverse(a, a + n);

	int ind = 0;
	//display();
	while(k > 0 and ind < n)
	{
		k --;
		a[ind] = x;
		ind ++;
		//display();
	}

	for(int i = 0; i < n; i ++) ans += a[i];

	return cout << ans << endl, 0;
}

#include <bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

int32_t main(){
    IOS;
    int n, k, x;
    cin >> n >> k >> x;
    int arr[n];
    for(int i = 0; i < n; i++)
        cin >> arr[i];

    int idx = n-1, res = 0;
    while( k && idx >= 0 ){
        res += x;
        k--, idx--;
    }

    while( idx >= 0 )
        res += arr[idx], idx--;

    cout << res << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){

	int n,k,x;
	cin >>n>>k>>x;
	int arr[n];
	int ans = 0;
	for(int i =0;i<n;i++){
		cin>>arr[i];
		if(i<n-k){
			ans += arr[i];
		}
		else{
			ans += min(arr[i],x);
		}
	}
	cout<<ans;
	return 0;
}

#include <iostream>
using namespace std;

int main(){
	int n, k, x, a, total = 0;
	cin >> n >> k >> x;

	for (int i = 0; i < n - k; i++){
		cin >> a;
		total += a;
	}

	total += k*x;
	cout << total << endl;

	return 0;
}

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

int main() {
	int n, k, x, a;
	cin >> n >> k >> x;

	int res = k * x;
	n -= k;
	for (int i = 0; i < n; i++) {
		cin >> a;
		res += a;
	}

	cout << res;
}

#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
//#include<>
using namespace std;
int main(){
	int s=0,n,x,k,a[100000],i,j;
	cin>>n>>k>>x;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=0;i<n;i++){
		if(i>=n-k) s+=x;
		else s+=a[i];
	}
	cout<<s;
//	system("pause");
}

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
//#pragma GCC optimization ("unroll-loops")
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define pb push_back
#define int long long
#define MEM(x) memset(x,0,sizeof(x))
#define vc vector<int>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define inf 0x3f3f3f3f
#define t_case int tt; cin>>tt; while (tt--)
#define lnginf 9223372036854775807
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define For(i,j,k) for (int i=(int)(j);i<(int)(k);i++)
#define rFor(i,j,k) for (int i=(int)(k-1);i>=(int)(j);i--)
#define ins insert
#define in(x); { for (auto &i : x) cin >> i; }
#define out(x); { for (auto i : x) cout<<i<<' ' ; }
#define pi  pair<int,int>
#define ti tuple<int,int,int>
#define PI 3.14159265359
#define decim(x) setprecision(x)
const long long LL_INF = (long long) 2e18 + 5;
using namespace std;
//void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
const int N=2e5+10,mod =1e9+7;
void solve(){
 int n,rem,red; cin>>n>>rem>>red;
 vector<int> v(n) in(v)
 reverse(all(v));
 int sum=0;
 For(i,0,n){
  if(i<rem)sum+=red;
  else sum+=v[i];
 }
 cout<<sum<<'\n';

}
int32_t main() {
   //clock_t clk = clock();
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
   fastio
   //t_case
    solve();
   // cerr << "Time : " << (double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC)+15<<" ms\n";

}

#include<bits/stdc++.h>
#include<cstdlib>
#define sf(x) scanf("%d",&x)
#define pf(x) printf("%d ",x)
#define sf2(x,y) scanf("%d %d",&x,&y)
#define pf2(x,y) printf("%d %d ",x,y)
#define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define pf3(x,y,z) printf("%d %d %d ",x,y,z)
#define sfc(c) scanf(" %c",&c)
#define pfc(c) printf("%c",c)
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define INF 1000000008
#define ENDL puts("")

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef unsigned int uint;
typedef long double ld;

int main()
{
    /*
    freopen("people.in","r",stdin);
    freopen("people.out","w",stdout);
    /**/

    int n,k,x;
    sf3(n,k,x);
    int s=0;
    for(int i=1; i<=n; i++)
    {
        int a;
        sf(a);
        if(i<=n-k) s+=a;
        else s+=x;
    }
    pf(s);

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
   long long ll, n, m, k ;
    cin >> n >> m >> k;

    long long  res = n - m ;
    long long sum = 0 ;

    for(int i = 0 ; i < n ; i++)
    {
        long long a ;
        cin >> a ;
        if(i < res )
            sum += a ;
      else
        sum += min(k , a) ;
    }

    cout << sum << endl ;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,s,i,j,l,x,k,sum=0;
    vector<int>v;
    scanf("%d %d %d",&a,&b,&c);
    for(i=0;i<a;i++)
    {
        scanf("%d",&x);
        v.push_back(x);
    }
    sort(v.begin(),v.end());
       l=a;
    for(j=0;j<=b;j++)
    {
        v[l--]=c;
        //printf("%d %d %d\n",l,c,v[l]);
    }
      for(k=0;k<a;k++)
      {
        sum=sum+v[k];
        //printf("%d\n",v[k]);
      }
      printf("%d",sum);

    return 0;
}

#include <bits/stdc++.h>

using namespace std;
//@formatter:off
struct _nl{}nl;bool _ns=0;template<typename T>void _p(const T&_){if constexpr(is_same<T,_nl>()){cout<<"\n";_ns=0;}
else{if(_ns)cout<<" ";cout<<_;_ns=1;}}template<typename...T>void out(const T&..._){(_p(_),...);}int ii(){int _;cin>>
_;return _;}vector<int>ia(int n){auto v=vector<int>(n);for(int i=0;i<n;i++)cin>>v[i];return v;}
//@formatter:on

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    auto n = ii(), k = ii(), x = ii();
    auto d = ia(n);
    int ans = 0;
    for (int i = 0; i < n - k; i++)
        ans += d[i];
    ans += x * k;
    out(ans, nl);

    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int n,k,x,a,ans=0;
	cin>>n>>k>>x;
	for(int i=1; i<=n-k; ++i) {
		cin>>a;
		ans+=a;
	}
	cout<<ans+k*x;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int N=105;
int n,k,x,a[N];
int main(){
	scanf("%d%d%d",&n,&k,&x);
	for (int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	int ans=0;
	for (int i=1;i<=n-k;i++)
		ans+=a[i];
	ans+=k*x;
	printf("%d",ans);
	return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int n,k,x,s=0,a;
    cin>>n>>k>>x;
    for(int i=0 ;i<n-k;i++){
		cin>>a;
		s+=a;
	}
    for(int i=n-k ;i<n;i++)s+=x;
    cout<<s;
}

#include"bits/stdc++.h"
using namespace std;
int main()
{
    int n,k,x;
    cin>>n>>k>>x;
    int arr[n+1];
    int m=n-k;
    int sum=0;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        if(m>0) sum+=arr[i];
        m--;
    }
    sum+=(k*x);
    cout<<sum<<endl;
    return 0;
}

#include <bits/stdc++.h>
#include <string>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;

int main(){
  ios::sync_with_stdio(false);
  int n,k,x,ans=0;
  cin >> n >> k >> x;
  for(int i=0;i<n;i++)
  {
      int y;
      cin >> y;
      if((i+k)<n) ans+=y;
  }

  cout<<ans+x*k<<endl;
   return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
int main()
{
	vector<ll>vec;
	ll n,i,j,k,x,y,t,m;
	cin >> n >> k >> x;
	for(i=0;i<n;i++)
	{
		cin >> y;
		vec.pb(y);
	}
	reverse(vec.begin(),vec.end());
	ll ans=0;
	for(i=0;i<k;i++)
		ans+=x;
	for(i=k;i<n;i++)
		ans+=vec[i];
	cout << ans << endl;
}

#include <bits/stdc++.h>

#pragma GCC optimize("Ofast")

using namespace std;

typedef long long ll;
typedef long double ld;
#define pdd pair<ld, ld>
#define pll pair<ll, ll>
#define pb push_back

const ll maxn = ll(5e5) + 1;
const ll inf = ll(1e17) + 123;
const ll mod = ll(1e9) + 7;

void solve() {
    ll n, k, x;
    cin >> n >> k >> x;
    vector<ll> a;
    for(ll i = 0; i < n; i++) {
        ll cur;
        cin >> cur;
        a.pb(cur);
    }
    for(ll i = 0; i < k; i++) {
        a[n - 1 - i] = x;
    }

    ll ans = 0;
    for(ll i = 0; i < n; i++) {
        ans += a[i];
    }
    cout << ans << endl;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    //ll start = clock();
    solve();

    //cout << fixed << setprecision(3) << ld(1.0) * (clock() - start) / CLOCKS_PER_SEC << endl;

    return 0;
}

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <map>

using namespace std;

int n,k,x,sum;
vector<int>a;

int main()
{
    cin>>n>>k>>x;
    a.resize(n);
    for(int i=0,s=n;i<n;i++,s--)
    {
        cin>>a[i];
        if(s>k)
        {
            sum+=a[i];
        }
        else
        {
            sum+=x;
        }
    }
    cout<<sum<<endl;

    return 0;
}

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define ascpqi priority_queue<int, vector<int>, greater<int> >
#define ascpql priority_queue<long long int, vector<long long int>, greater<long long int> >
#define ascpqpi priority_queue<pair<int, int>, vector<pair<int, int> greater<pair<int, int> > >
#define descpqi priority_queue<int>
#define descpql priority_queue<long long int>
#define descpqpi priority_queue<pair<int, int> >
#define pii pair<int, int>
#define pll pair<long long int, long long int>
#define puu pair<unsigned long long int, unsigned long long int>
#define pcc pair<char, char>
#define pss pair<string, string>
#define pi acos(-1)
#define vi vector<int>
#define vl vector<long long int>
#define vu vector<unsigned long long int>
#define vd vector<double>
#define vc vector<char>
#define sortv(x) sort(x.begin(), x.end())
#define vpi vector<pair<int, int> >
#define vpl vector<pair<long long int, long long int> >
#define vpd vector<pair<double, double> >
#define vpc vector<pair<char, char> >
#define vps vector<pair<string, string> >
#define debug1(a) cout << a << endl;
#define debug2(a, b) cout << a << ' ' << b << endl
#define debug3(a, b, c) cout << a << ' ' << b << ' ' << c << endl
#define debugarr(arr, n) for(int i=0; i<n; i++) {cout << arr[i] << ' ';} cout << endl
#define imax pow(2, 31)-1
#define imin -(pow(2, 31)-1)
#define llmax pow(2, 63)-1
#define llmin -(pow(2, 63)-1)
#define ullmax pow((ull) 2, (ull) 64)-1
#define ullmin 0
#define uimin 0
#define uimax pow(2, 32)-1
#define outround(x) cout << fixed << setprecision(x)
#define multitest int t; cin >> t; while(t--) solve();
using namespace std;

ull bigMod(ull b, ull p, ull m) { // (b^p)%m
    b=b%m;
    if(p==0) return 1;
    else if(p%2==0) return ((ull) pow(bigMod(b, p/2, m), 2))%m;
    else return ((ull) pow(bigMod(b, (p-1)/2, m), 2)*b)%m;
}

ull nCr(ull n, ull r) {
    ull ans=1;
    if(r>=n-r) {
        for(ull i=r+1;i<=n;i++) {
            ans=ans*i;
        }
        for(ull i=1;i<=n-r;i++) {
            ans=ans/i;
        }
    }
    else {
        for(ull i=n-r+1;i<=n;i++) {
            ans=ans*i;
        }
        for(ull i=1;i<=r;i++) {
            ans=ans/i;
        }
    }
    return ans;
}

ull fib(ull a) {
    const long double root5=sqrt(5);
    const long double root5plus1div2=(root5+1)/2;
    return round(pow(root5plus1div2, a)/root5);
}

ull gcd(ull a, ull b) {
    if(b==0) return a;
    else return gcd(b, a%b);
}

ull lcm(ull a, ull b) {
    return ((a*b)/gcd(a, b));
}

bool isPrime(ull a) {
    if(a%2==0) return false;
    for(int i=3; i<=sqrt(a); i+=2) {
        if(a%i==0) return false;
    }
    return true;
}

bool isComposite(ull a) {
    if(isPrime(a)) return false;
    else return true;
}

bool coPrime(ull a, ull b) {
    if(gcd(a, b)==1) return true;
    else return false;
}

ld toRadian(ld deg) {
    return (deg*pi/180);
}

ull strToInt(string a) {
    int len=a.length();
    int power=0;
    ull tot=0;
    for(int i=len-1; i>=0; i--) {
        tot=tot+pow(10, power)*(a[i]-'0');
        power++;
    }
    return tot;
}

bool desc(int a, int b) {
    return a>b;
}

ull mex(int* arr, int n) {
    sort(arr, arr+n);
    int now=-1;
    for(int i=0; i<n; i++) {
        if(arr[i]==now+1) {
            now++;
        }
        else if(arr[i]==now) {

        }
        else {
            return now+1;
        }
    }
    return now+1;
}

ull modInv(ull n, ull p) {
    return bigMod(n,p-2,p);
}

ld slope(ld xdiff, ld ydiff) {
    return (ydiff/xdiff);
}

bool binSearch(ll* arr, ll n, ll target) {
    ull l=0, r=n-1;
    while(l<r) {
        int mid=(l+r)/2;
        if(arr[mid]>=target) {
            r=mid;
        }
        else {
            l=mid+1;
        }
    }
    if(arr[l]==target) {
        return true;
    }
    else {
        return false;
    }
}

int ascii(char x) {
    return int(x);
}

ld sine(ld x) {
    return sin(toRadian(x));
}

ld cosine(ld x) {
    return cos(toRadian(x));
}

ld tangent(ld x) {
    return tan(toRadian(x));
}

ull hammDist(string a, string b, ull len) {
    ull cnt=0;
    for(int i=0; i<len; i++) {
        if(a[i]!=b[i]) cnt++;
    }
    return cnt;
}

ull binStrToInt(string a, ull len) {
    ull num=0;
    for(int i=len-1; i>=0; i--) {
        if(a[i]=='1') {
            num=num+pow((ull) 2, len-i-1);
        }
    }
    return num;
}

bool isVowel(char a) {
    if(a=='a'||a=='e'||a=='i'||a=='o'||a=='u') return true;
    else return false;
}

int fib(int a) {
    if(a==0||a==1) return 1;
    else return fib(a-1)+fib(a-2);
}

void solve() {
    int n,k,x;
    cin>>n>>k>>x;
    int arr[n],tot=0;
    for(int i=0; i<n; i++) cin>>arr[i];
    sort(arr,arr+n);
    for(int i=0; i<n-k; i++) {
        tot+=arr[i];
    }
    for(int i=n-k; i<n; i++) {
        tot+=min(arr[i],x);
    }cout<<tot<<endl;
}

int main() {
    cin.tie(NULL);
    cout.tie(NULL);
    ios::sync_with_stdio(false);
    // multitest
    solve();
}

/*
0abcdefghijklmnopqrstuvwxyz1234567896
^^   ^   ^     ^     ^      ^ ^ ^ ^ ^
*/

#include <bits/stdc++.h>

using namespace std;

//shoumo

#define LL long long
#define PI 2*acos(0.0)
#define INF INT_MAX
#define MOD 1000000007

int main()
{
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n,c=0,k,x,a,i;
	cin>>n>>k>>x;
	for(i=0;i<n;i++)
	{
		cin>>a;
		if(i<n-k) c+=a; else c+=x;
	}
	cout<<c;
	return 0;
}

#include <iostream>
using namespace std;
main(){
    int n,k,x,q,ans = 0, i;
    cin>>n>>k>>x;
    for (i = 0;i<n;i++){
        cin>>q;
        if (i < n-k)ans += q;
        else ans += min(x,q);
    }cout<<ans;
    }

#include<iostream>
using namespace std;
int a[101];
int x,n,k,i,l,ans;
main() {
 cin>>n>>k>>x;
  for(i=1;i<=n-k;i++){
   cin>>a[i];
      ans=ans+a[i];
 }
   ans+=k*x;

 cout<<ans<<endl;

}

#include <bits/stdc++.h>

using namespace std;
int main()
{
    int n,k,x,i,arr[102],sum=0;
    cin>>n>>k>>x;
    sum+=x*k;
    for (i=0;i<n;i++){
        cin>>arr[i];
    }
    for (i=0;i<n-k;i++){
         sum+=arr[i];
    }
    cout<<sum;

    /*

    int a,n=5;
    while( n--){
        cin>>x;
        cnt+=(x%2==0);

    }
    cout<<cnt<<" valores pares"<<'\n';

    /*
    int a,n=5;
    while( n--){
        cin>>x;
        if (x>0)p++;
        if (x<0)ne++;
        if (x%2)f++;
        else z++;
    }
    cout<<z<< " valor(es) par(es)"<<'\n';
    cout<<f<< " valor(es) impar(es)"<<'\n';
    cout<<p<< " valor(es) positivo(s)"<<'\n';
    cout<<ne<< " valor(es) negativo(s)"<<'\n';

    /*
    int a,n=5;
    while( n--){
        cin>>x;
        cnt+=(x%2==0);

    }
    cout<<cnt<<" valores pares"<<'\n';

    /*
    for (i=0;i<x;i++){
        cin>>p[i].first;
        p[i].second=i+1;
    }
    sort(p,p+x);
    cout<< p[x-1].first<< '\n'<<p[x-1].second<<'\n';

    /*

    char y;
    cin>>n;
    while(n--){
        cin>>x>>y;
        y== 'C'?c+=x:y== 'R'?r+=x:s+=x;
    }
    printf("Total: %d cobaias\n",s+c+r);
    printf("Total de coelhos: %d\n",c);
    printf("Total de ratos: %d\n",r);
    printf("Total de sapos: %d\n",s);
    printf("Percentual de coelhos: %.2f %%\n",(double)(c*100)/(s+c+r));
    printf("Percentual de ratos: %.2f %%\n",(double)(r*100)/(s+c+r));
    printf("Percentual de sapos: %.2f %%\n",(double)(s*100)/(s+c+r));

    /*
    int i,x,n,j=0,k=0,sum=0;
    cin>>n;
    for (i=0;i<n;i++){
        cin>>x;
        if (x%2==0)z[j++]=x;
        else f[k++]=x;
    }

    int F=k;
    int Z=j;
    for (i=0;i<F-1;i++){
       for (j=i+1;j<F;j++){
      //  if (ceil(double(sqrt(f[i],f[j])))==sqrt(f[i],f[j])sum++;
      x=sqrt(2,5);
      cout<<x<<'\n';
       }
    }

*/

    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int n,k,x,a[1001],sum(0);
    cin >> n >> k >> x;
    for(int j=1;j<=n;j++)
    {
        cin >> a[j];
    }
    for(int j=1;j<=n-k;j++)
    {
        sum += a[j];
    }
    cout << sum + k*x;
}

#include<bits/stdc++.h>

using namespace std;

int n, k, a, ans, x;

int main() {

  cin >> n >> k >> x;

  for( int i = 0; i < n - k; i ++ ) {

    cin >> a; ans += a;

  }

  ans += x * k;

  cout << ans << endl;

  return 0;

}

#include <iostream>
using namespace std;

int a[101];
int n,k,x,i,ans;

main () {
     cin>>n>>k>>x;
     for (i=1;i<=n;i++)
     cin>>a[i];

     for (i=1;i<=n;i++)
      if (i>n-k) a[i]=x;

      for (i=1;i<=n;i++)
      ans=ans+a[i];

      cout<<ans<<endl;
     }

#include<bits/stdc++.h>
using namespace std;

#define ll long long int
#define pi 3.141592653589793238
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define mod 1000000007

    ll mod_pow(ll a,ll b,ll m)
    {
        ll res=1;
        while(b)
        {
            if(b&1)
                res=(res*a)%m;

            a=(a*a)%m;
            b>>=1;
        }
        return res;
    }

void solve()
{
    ll n,k,x;
    cin>>n>>k>>x;
    vector<ll> a(n);
    // ll ans=0;
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll ans=x*(k);
        for(ll i=0;i<n-k;i++)
            ans+=a[i];
        cout<<ans;
    return;
}

int main()
{
    FAST;
    #ifndef ONLINE_JUDGE
        freopen("input1.txt","r",stdin);
        freopen("output1.txt","w",stdout);
    #endif
    ll q;
    q=1;
    // cin>>q;
    while(q--)
        solve();
    return 0;
}

#include<bits/stdc++.h>
#define NN 110

using namespace std;

int a[NN];

int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n, k, x;
	cin>>n>>k>>x;
	for(int i=1; i<=n; i++) cin>>a[i];
	sort(a+1, a+n+1);
	int ans=0;
	for(int i=1; i<=n-k; i++) ans+=a[i];
	ans+=k*x;
	cout<<ans<<endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,x,c=0;
    cin>>n>>m>>x;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    sort(a,a+n);

    for(int i=0;i<m;i++)a[n-i-1]=x;

    for(int i=0;i<n;i++)c+=a[i];

    cout << c <<endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main()
{
    /*
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    */
    ll n, x,k;cin>>n>>k>>x;
    ll arr[n];
    for(ll i = 0; i< n; i++){
        cin>>arr[i];
    }
    for(int i = n-1; i>=n-k;i--){
        if(arr[i]>x){
            arr[i] = x;
        }
    }
    ll sum = 0;
    for(int i = 0; i< n;i++){
        sum+=arr[i];
    }
    cout<<sum;
    return 0;
}

//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
using namespace std;
typedef long long ll;
#define free  freopen ("input.txt", "r", stdin);freopen ("output.txt", "w", stdout);
#define Fast  ios::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define mp make_pair

bool vowel(char che)
{
    if (che == 'a' || che == 'e' || che == 'i' || che == 'o' || che == 'u' || che == 'y')
        return true;
    else
        return false;
}

const int N = 3e5+5;
const int mod = 1e9+7;
ll a[N], b[N], c, d, dp, dis;
char o;
bool mark, h;
string s;
deque <int> dq;
vector <ll> vm, vp, vt;
int a1[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main()
{
    Fast
    ll t, n, m, k = 0, f = 0, sum = 0, ans = 0;
    cin >> n >> k >> m;
    for (int i = 0; i < n; i++){
        cin >> f;
        if (i < (n-k))
            ans += f;
    }
    ans += k*m;
    cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;

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

  long long sum=0;
  for(int i=0; i<n-k; i++){
    sum+=a[i];
  } sum+=k*x; cout<<sum;

}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    int k,x;
    int s[1111];
    while(cin>>n)
    {
        cin>>k>>x;
        for(int i=0;i<n;i++)
        cin>>s[i];
        if(n<=k)
        cout<<n*x<<endl;
        else
        {
            int sum=x*k;
            for(int i=0;i<n-k;i++)
            sum+=s[i];
            cout<<sum<<endl;
        }
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

void chores(int n,int k,int x,int arr[]){
    int res=0;
	for(int i=n-1;i>=n-k;i--)
        arr[i]=x;
	for(int j=0;j<n;j++)
        res+=arr[j];
  	cout<<res;
}
int main(){
    int n,k,x;
    cin>>n;
    cin>>k;
    cin>>x;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    chores(n,k,x,arr);
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define dd(x) cout << #x << " = " << x << ','
#define de(x) cout << #x << " = " << x << endl
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
const int INF = 0x3f3f3f3f;
const int MOD = (int)1e9+7;
const int maxn = (int)2e4+7;
int n,a[20005],s[20005];
int main()
{
    int Q;
    cin>>Q;
    rep(q,0,Q){
        scanf("%d",&n);
        memset(a,0,sizeof(a));
        rep(i,1,n + 1) scanf("%d",&a[i]);
        sort(a + 1,a + n + 1);
        s[1] = a[1];
        rep(i,2,n + 1) s[i] = s[i - 1] + a[i];
        int j = n / 2;
        ll ans = s[n] * n;
        rep(i,1,n - 1){
            int w1 = s[i], n1 = i;
            //j = max(j, (i + n) / 2);
            //j = (i + n) / 2;
            j = i + 1;
            int w2 = s[j] - s[i],n2 = j - i,w3 = s[n] - s[j],n3 = n - j;
            while(j < n - 1 && (w2 - w3) + (n2 - n3 + 2) * a[j + 1] <= 0){
                w2 += a[j + 1];
                w3 -= a[j + 1];
                n2 ++;
                n3 --;
                j ++;
            }
            //ans = min(ans,(ll)w1 * n1 + (ll)w2 *n2 + (ll)w3 * n3);
            if(((ll)w1 * n1 + (ll)w2 *n2 + (ll)w3 * n3) < ans)
            ans = (ll)w1 * n1 + (ll)w2 *n2 + (ll)w3 * n3;
            //dd(n1),dd(n2),de(n3);
            //dd(i),dd(j),de(ans);
        }
        printf("%d\n",ans);
    }
    return 0;
}

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n,m,k;
    cin>>n; cin>>m; cin>>k;
    int tot=0;
    vector<int> arr(n,0);
    for(int i=0;i<n;i++) cin>>arr[i];

    for(int i=0;i<n;i++)
    {
        if (!((i/m)%2 == 0 || (n-m*(i/m)) < m))
            arr[i] = k;
    }
    for(auto ele:arr) tot+=ele;
    cout<<tot<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

#define s(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define ss(a) scanf("%s",a)

typedef long long int LL;
typedef pair<int,int> II;
typedef vector<int> VI;

int main(){
	int n,k,x;
	cin>>n>>k>>x;
	int inp[105];
	int sum = 0;
	for(int i=0;i<n;i++){
		cin>>inp[i];
		sum += inp[i];
	}
	if(n>=1 && inp[n-1]>x)
		sum = (sum - inp[n-1] + x);
	if(n>=2 && inp[n-2]>x)
		sum = (sum - inp[n-2] + x);
	cout<<sum<<endl;
	return 0;
}

#include <iostream>
using namespace std;
#include <math.h>
int main()
{
	int n, k, x, S=0;
	int a[100];
	int b[100];
	cin >> n >> k >> x;
	for (int i = 1; i <= n; i++)
	{
		cin>> a[i];
	}
	for (int i = 1; i <= (n - k); i++)
	{
		b[i] = a[i];
	}
	for (int i = 1; i <= (n); i++)
	{
		int min = 101;
		for (int j = 1; j <= (n-k); j++)
		{
			if (b[j] <= min) min = b[j];
		}
		for (int j = 1; j <= (n - k); j++)
		{
			if (b[j] == min) b[j] = a[i];
			break;
		}
	}
	for (int i = 1; i <= (n - k); i++)
	{
		S = S + b[i];
	}
	cout << S+k*x ;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define dd(x) cout << #x << " = " << x << ','
#define de(x) cout << #x << " = " << x << endl
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
const int INF = 0x3f3f3f3f;
const int MOD = (int)1e9+7;
const int maxn = (int)2e4+7;
int n,a[20005],s[20005];
int main()
{
    int Q;
    cin>>Q;
    rep(q,0,Q){
        scanf("%d",&n);
        memset(a,0,sizeof(a));
        rep(i,1,n + 1) scanf("%d",&a[i]);
        sort(a + 1,a + n + 1);
        s[1] = a[1];
        rep(i,2,n + 1) s[i] = s[i - 1] + a[i];
        int j = n / 2;
        ll ans = s[n] * n;
        rep(i,1,n - 1){
            int w1 = s[i], n1 = i;
            //j = max(j, (i + n) / 2);
            //j = (i + n) / 2;
            j = i + 1;
            int w2 = s[j] - s[i],n2 = j - i,w3 = s[n] - s[j],n3 = n - j;
            while(j < n - 1 && (w2 - w3) + (n2 - n3 + 2) * a[j + 1] <= 0){
                w2 += a[j + 1];
                w3 -= a[j + 1];
                n2 ++;
                n3 --;
                j ++;
            }
            //ans = min(ans,(ll)w1 * n1 + (ll)w2 *n2 + (ll)w3 * n3);
            if(((ll)w1 * n1 + (ll)w2 *n2 + (ll)w3 * n3) < ans)
            ans = (ll)w1 * n1 + (ll)w2 *n2 + (ll)w3 * n3;
            //dd(n1),dd(n2),de(n3);
            //dd(i),dd(j),de(ans);
        }
       // printf("%lld\n",ans);
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int x, y, z, A[109];
    int chor = 0;
    scanf("%d",&x, &y, &z);
    for(int i = 0; i < x ;i ++)
    {
        scanf("%d", &A[i]);
    }
    for(int i = 0; i < x - y - 1 ; i++)

        chor += A[i];

    chor += (y * z);
    printf("%d", chor);

    return 0;
}

/**OOO**/
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mem(x,y) memset(x,y,sizeof(x))

using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);

int n,k,x;
cin>>n>>k>>x;
    int arr[n+5];
    int total=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }

    for(int i=0;i<n-k;i++)
    {
        total=total+arr[i];
    }

    int temp=0;
    int j=n-1;
    for(int i=0;i<k;i++)
    {
        if(x<arr[j])temp=temp+x;
        else temp=temp+arr[j];
        j--;
    }
    //cout<<total<<endl;
    //cout<<temp<<endl;

    cout<<total+temp<<endl;

return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,x,p,q,ans=0,cnt=0;;
    cin>>n>>k>>x;
    int a[n+5];
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];

    }

    for(int i=n;i>1;i--)
    {
        if(a[i]>=a[i-1] && cnt<k)
        {
            cnt++;
            ans+=x;

        }
        else ans+=a[i];
    }
    ans+=a[1];
    cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;

int flag[2000009];
vector<int>A,B;

int main()
{
    //freopen("read.in","r",stdin);
    int TRUE=0,n,x,y;
    while(scanf("%d",&n)==1){
        TRUE++;
        for(int i=0;i<n;i++){
            cin>>x;
            A.push_back(x);
            flag[x] = TRUE;
        }
        for(int i=0;i<n;i++){
            cin>>y;
            B.push_back(y);
            flag[y] = TRUE;
        }
        int even = 0;
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                x= (A[i] ^ A[j]);
                if(x<=2000000 && flag[x]==TRUE){
                    even++;
                }
            }
        }

        if(even & 1)cout<<"Koyomi"<<endl;
        else cout<<"Karen"<<endl;
    }
}

#include <iostream>
using namespace std;
int main()
{
	int n=0,k=0,m=0;
	int sum=0;
	cin>>n>>k>>m;
	int c[n];
	for(int i=0;i<n;i++){
		cin>>c[i];
		sum+=c[i];
	}
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			if(c[i]>c[j]){
				int a = c[j];
				c[j] = c[i];
				c[i] = a;
			}
		}
	}
	if(c[n-1]==c[n-2]){
	sum = sum - c[n-1] - c[n-2] + 2;}
	else
	sum = sum - c[n-1] - c[n-2] + 2*k;
	cout<<"\n"<<sum;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n,a,b,c;
    cin>>n>>a>>b>>c;

    int x=min(a,min(b,c));

    if(x==a||x==b||n==1){
        cout<<(n-1)*min(a,b);
    }else
    {
	cout<<min(a,b)+c*(n-2);
    }

	return 0;
}

#include <iostream>
#include <assert.h>
#include<string>
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
 int n,k,x,ans=0;
 cin>>n>>k>>x;
 int i1[n];
 vector<int>ans1;
 for(int i=0;i<n;i++)
 {
    cin>>i1[i];
 }
 i1[n-1]=x;
    i1[n-2]=x;
 for(int i=0;i<n;i++)
    ans+=i1[i];
 cout<<ans;
 }

#include<iostream>
#include<vector>
using namespace std;
int main(){
   int n, k, x, sum = 0; cin >> n >> k >> x;
   vector <int> v(n);
   for(int i = 0; i < n-k; i++){
       cin >> v[i];
   }
   v[n-k] = x; v[n - k +1] = x;
   for(int i = 0; i < v.size(); i++){
      sum += v[i];
   }
   cout << sum;
}

#include <iostream>

using namespace std;

int n, k, x, sum = 0;
int chores[100];

int main()
{
    cin >> n >> k >> x;

    for(int i = 0; i < n; ++i)
        cin >> chores[i];

    for(int i = n - k; i < k; ++i)
        chores[i] = x;

    for(int i = 0; i < n; ++i)
        sum += chores[i];

    cout << sum;

    return 0;
}

#include <stdio.h>

int main()
{
    int n, k, x;
    scanf("%d %d %d", &n, &k, &x);

    int *a;
    a = new int[n];

    for (int i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
    }

    int sum = 0;
    for (int i = 0; i < n; i++)
    {
        if (i < k)
            sum += a[i];
        else
            sum += x;
    }

    printf("%d", sum);

    return 0;
}

#include <iostream>
using namespace std;
int a[100],k,x,i,t,w,n,p;
int main()
{
    cin>>n;
    cin>>p;
    cin>>x;
    for(i=1; i<=n; i++)
    cin>>a[i];
    for(i=1; i<=n; i++)

                               w=w+a[i];

    t=a[n];
k=a[n-1];

                               w=w-t-k+p*x;
                               cout<<w;
                               }

#include <stdio.h>
#include <iostream>
using namespace std;

int main()
{
    int n , k , x ,a ,sum=0;
    scanf("%d%d%d",&n,&k,&x);
    sum=x*k;
    while(n>k){
        scanf("%d",&a);
        sum+=a;
        n--;
    }
    printf("%d",(sum+k*x));

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define KOD ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0) ;
#define sz size()
#define S second
#define F first
#define FIX(x) fixed << setprecision(x)
#define SORT(x) sort(x.begin(),x.end())
#define Rev(a) reverse(a.begin() , a.end());
#define pb push_back
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef unordered_map<int,int> wi;
typedef unordered_set<int> si;
main(){
	int a, b ,c;
	cin >> a >> b >> c;
	int n[a];
	int sum = 0;
	for(int i = 0 ; i < a ; i++){
		cin >> n[i];
		if(i < a-2){
			sum+=n[i];
		}
	}
	cout << sum+b*c;
}

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>

using namespace std;

int main() {
    int n, k, x, t, s(0);
    cin >> n >> k >> x;
    while (n--) {
        cin >> t;
        s += t;
        if (n == k) break;
    }
    cout << s + k * x << '\n';
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n,k,x;
  cin>>n>>k>>x;
  int a[n],sum=2*x;
  for (size_t i = 0; i < n; i++) cin>>a[i];
  for (size_t i = 0; i < n-k; i++) sum+=a[i];
  cout<<sum;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define fr(i, n) for(int i=0;i<n;i++)
#define forall(i, j, n) for(int i=j; i<n; i++)
#define all(c) c.begin(), c.end()
#define tr(container, it) for (__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define present(container, element) (container.find(element) != container.end())
#define cpresetn(container, element) (find(all(container)), element) != container.end())
#define sz(a) int((a).size())
#define pb(a) push_back(a)
#define si(n) scanf("%d", &n)
#define sll(n) scanf("%lld", &n)
#define pi(n) 0*printf("%d\n", n)
#define pll(n) 0*printf("%lld\n", n)
#define SET(container, value) memset(container, value, sizeof container)

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << endl;
}
template<typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names+1, ',');
	cerr.write(names, comma-names) << " : " << arg1 << " | "; __f(comma+1, args...);
}

int main(){
  int n, k, x;
  int a[100010];
  cin >> n >> k >> x;
  fr(i, n) si(a[i]);
  int ans = 0;
  fr(i, n-k) ans+=a[i];
  ans += 2*x;
  cout << ans << endl;
  return 0;
}

#include<iostream>
using namespace std;
int main(){
	int n, k, x;
	cin >> n >> k >> x;
	int *num = new int[n];
	for (int i = 0; i < n; i++)
		cin >> num[i];
	int *maxn = new int[k];
	int ptr = 0;
	int temp = 0;
	int pt = 0;
	for (int i = 0; ptr < k; i++){
		if (num[i] > temp){
			temp = num[i];
			pt = i;
		}
		if (i == n - 1){
			maxn[ptr] = temp;
			temp = 0;
			ptr++;
			i = 0;
			num[pt] = 0;
		}
	}
	int res = k * x;
	for (int i = 0; i < n; i++){
		res += num[i];
	}
	cout << res;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,x;
    cin>>n>>k>>x;
    long long a[n+1],sum=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum=sum+a[i];
    }
    sort(a,a+n);
    sum=sum-a[n-1]-a[n-2];
    sum=sum+k*x;
    if(n>1)cout<<sum;
    else cout<<k*x;

}

#include <iostream>

using namespace std;

int main()
{
    int *arr;
    int n,k,x;

    cin >> n>>k>>x;

    arr = new int[n];

    for (int i = 0; i < n; i++) {

        cin >> arr[i];
    }

    int temp;

        for (int i = 0; i < n - 1; i++) {
        for (int j = 0; j < n - i - 1; j++) {
            if (arr[j] > arr[j + 1]) {

                temp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = temp;
            }
        }
    }

    for ( int i=n-k; i<n; i++ ) {
        arr[i]=x;
    }

    int sum=0;
    for ( int i = 0 ; i <= n; i++ ) {
        sum+=arr[i];
    }

    cout<<sum;

    delete [] arr;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

const int MAXN = 105;

int n, k, x;
int a[MAXN];

int main()
{
    cin >> n >> k >> x;
    k = min(k, n);
    int ans = 0;
    for (int i = 1; n-i >= k; i++) ans += a[i];
    ans += k*x;
    cout << ans << endl;
    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int n,k,x,s=0,a;
    cin>>n>>k>>x;
    for(int i=0 ;i<n-k;i++){
		cin>>a;
		s+=a;
	}
    for(int i=n-k ;i<n;i++)s+=k;
    cout<<s;
}

#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,x,k,sum=0;
cin>>n>>x>>k;
int arr[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
sum+=x*k;
for(int i=0;i<k;i++)
    sum+=arr[i];
cout<<sum;
    return 0;
}

//#pragma GCC optimize("O3")
//GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,popcnt,abm,mmx")
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
using namespace std;

#define PI acos(-1)
#define pb push_back
#define fi first
#define se second
#define TASK ""
#define move djskdfjksl
#define sz(a) (int)(a).size()
#define all(c) (c).begin(), (c).end()
#define TIMESTAMP fprintf(stderr, "Execution time: %.3lf s.\n", (double)clock()/CLOCKS_PER_SEC)

#define has(mask, i) ((mask >> i) & 1)

#ifndef LOCAL
	#define cerr if (0) cerr
#endif

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) (void)42
#endif

typedef long long ll;
typedef long double ld;
typedef vector < int > vi;
typedef vector < ll > vll;
typedef pair < int, int > pii;
typedef vector < vi > vvi;
typedef vector < pii > vpii;
typedef vector < string > vs;

const int MAXN = (int)1e5 + 22;

int N;
string s;
int sum[MAXN];

bool check(int len) {
	if (len > N)
		return 0;
	for (int i = len; i <= N; i++) {
		if (sum[i] - sum[i - len] == len / 2)
			return 1;
	}
	return 0;
}

void solve() {
	cin >> N >> s;
	for (int i = 0; i < N; i++)
		sum[i + 1] = sum[i] + (s[i] - '0');
	int l = 0, r = (N >> 1) + 1;
	while (r - l > 1) {
		int mid = (l + r) / 2;
		if (check(2 * mid))
			l = mid;
		else
			r = mid;
	}
	cout << l;
}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
#ifdef LOCAL
	assert(freopen("xxx.in", "r", stdin));
	assert(freopen("xxx.out", "w", stdout));
#else
	//freopen(TASK".in", "r", stdin);
	//freopen(TASK".out", "w", stdout);
#endif
	solve();
#ifdef LOCAL
	TIMESTAMP;
#endif
	return 0;
}

#include <bits/stdc++.h>

using namespace std;
int chor;
int main()
{
    int x, y, z, A[109];
    scanf("%d",&x, &y, &z);
    for(int i = 0; i < x ;i ++)
    {
        scanf("%d", &A[i]);
    }
    for(int i = 0; i < x - y - 1 ; i++)
    {
        chor += A[i];
    }
    chor += (y * z);
    printf("%d", chor);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define fr(i, n) for(int i=0;i<n;i++)
#define forall(i, j, n) for(int i=j; i<n; i++)
#define all(c) c.begin(), c.end()
#define tr(container, it) for (__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define present(container, element) (container.find(element) != container.end())
#define cpresetn(container, element) (find(all(container)), element) != container.end())
#define sz(a) int((a).size())
#define pb(a) push_back(a)
#define si(n) scanf("%d", &n)
#define sll(n) scanf("%lld", &n)
#define pi(n) 0*printf("%d\n", n)
#define pll(n) 0*printf("%lld\n", n)
#define SET(container, value) memset(container, value, sizeof container)

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << endl;
}
template<typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names+1, ',');
	cerr.write(names, comma-names) << " : " << arg1 << " | "; __f(comma+1, args...);
}

int main(){
  int n, k, x;
  int a[100010];
  cin >> n >> k >> x;
  fr(i, n) si(a[i]);
  int ans = 0;
  fr(i, n-2) ans+=a[i];
  ans += 2*x;
  cout << ans << endl;
  return 0;
}

//#pragma GCC optimize("O3")
//GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,popcnt,abm,mmx")
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
using namespace std;

#define PI acos(-1)
#define pb push_back
#define fi first
#define se second
#define TASK ""
#define move djskdfjksl
#define sz(a) (int)(a).size()
#define all(c) (c).begin(), (c).end()
#define TIMESTAMP fprintf(stderr, "Execution time: %.3lf s.\n", (double)clock()/CLOCKS_PER_SEC)

#define has(mask, i) ((mask >> i) & 1)

#ifndef LOCAL
	#define cerr if (0) cerr
#endif

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) (void)42
#endif

typedef long long ll;
typedef long double ld;
typedef vector < int > vi;
typedef vector < ll > vll;
typedef pair < int, int > pii;
typedef vector < vi > vvi;
typedef vector < pii > vpii;
typedef vector < string > vs;

const int MAXN = (int)1e5 + 22;

int N;
string s;
int sum[MAXN];

bool check(int len) {
	if (len > N)
		return 0;
	for (int i = len; i <= N; i++) {
		if (sum[i] - sum[i - len] == len / 2)
			return 1;
	}
	return 0;
}

void solve() {
	cin >> N >> s;
	for (int i = 0; i < N; i++)
		sum[i + 1] = sum[i] + (s[i] - '0');
	int l = 0, r = N + 1;
	while (r - l > 1) {
		int mid = (l + r) / 2;
		if (check(2 * mid))
			l = mid;
		else
			r = mid;
	}
	cout << 2 * l;
}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
#ifdef LOCAL
	assert(freopen("xxx.in", "r", stdin));
	assert(freopen("xxx.out", "w", stdout));
#else
	//freopen(TASK".in", "r", stdin);
	//freopen(TASK".out", "w", stdout);
#endif
	solve();
#ifdef LOCAL
	TIMESTAMP;
#endif
	return 0;
}

#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;
typedef int intor;
#define int long long
#define NMAX 100000

int pref1[NMAX];
int pref0[NMAX];

int diff[NMAX];
int min_pos[NMAX + 10];
intor main()
{
	memset(min_pos, -1, sizeof(min_pos));
	int n;
	cin >> n;
	string str;
	cin >> str;

	for (int i = 0; i < n; i++)
	{
		if (i != 0)
		{
			pref1[i] = pref1[i - 1];
			pref0[i] = pref0[i - 1];
		}
		else
		{
			pref1[i] = 0;
			pref0[i] = 0;
		}

		if (str[i] == '1')
			pref1[i]++;
		else
			pref0[i]++;

		diff[i] = pref1[i] - pref0[i];

		if (min_pos[diff[i]] == -1)
			min_pos[diff[i]] = i;
	}
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int d = i - min_pos[diff[i]];
		ans = max(ans, d);
	}
	cout << ans;

	return 0;
}

#include <iterator>
#include <iostream>
#include <iterator>
#include <set>
#include <algorithm>
using namespace std;
int main(){

	set<long>se;
	set<long>::iterator itr;
	set<long>::iterator j;
	long n,k,x,a,i,sum;
	cin>>n>>k>>x;
	while(n--)
	{
		cin>>a;
		se.insert(a);

	}
	sum=0;

	for(i=0;i<k;i++)
	{
		sum=sum+x;
	}
	j=se.begin();
	itr=std::next(j,k);

	for(;itr!=se.end();itr++)
	sum=sum+(*itr);

	cout<<sum<<endl;

return 0;

}

#include <iostream>
using namespace std;
int main()
{
    int n,k,x,a,sum=0,i;
    cin>>n>>k>>x;
    for(i=1; i<=n-k;i++){
        cin>>a;
        if(i<=n-k)
            sum=sum+a;
        else
            sum=sum+x;
    }
    cout<<sum<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std ;
int main ()
{
    int n , k , l ;
    int num[105];
    scanf("%d%d%d",&n,&k,&l);
    for(int i = 0 ; i< n ; i++)
    {
        scanf("%d",&num[i]);
    }
    for(int i = n-1 ; i>0 && k>0 ; i--)
    {
        if(num[i]>l)
        {
            num[i]=l;
        }
        k--;
    }
    int sum = 0;
    for(int i= 0 ; i<n;i++)
    {
        sum +=num[i];
    }
    printf("%d\n",sum);
}

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int n,k,x;
    cin>>n>>k>>x;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    sort(arr,arr+n);
    long long int sum=0;
    for(int i=0;i<n-k;i++){
        sum+=arr[i];
    }
    for(int i=n-k;i<n;i++){
        if(arr[i]<k)
        sum+=arr[i];
         else sum+=k;
    }
    cout<<sum<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a[101];
int main()
{
	int ans;
	int n,k,x;
	cin>>n>>k>>x;
	for(int i=1;i<=n;i++)
		cin>>a[i],ans+=a[i];
	sort(a,a+n);
	for(int i=n;i>n-k;i--)
	{
		if(a[i]>x)
		{
			ans-=a[i];
			ans+=x;
		}
	}
	cout<<ans;
	return 0;
}

#include <iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
int n,x,k,sum=0;
cin>>n>>x>>k;
int arr[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
sum+=x*k;
int ma=max(x,k);
int w=n-ma;
int m=max(w,ma);
for(int i=0;i<m;i++)
    sum+=arr[i];
cout<<sum;
    return 0;
}

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{//hjklkjhghjkjhg
    int n,k,x,a,i;
    cin>>n,k,x;
    x = k*x;
    for(i=0; i<n-k; i++){
    cin>>a;
    x += a;
    }
    cout<<x;
}

#include <stdio.h>
#include <iostream>
#include <algorithm>

using namespace std;

const int MAX = 111;
int n, k, x, a[MAX], ans, tmp;

int main() {
	while (cin >> n >> k >> x) {
		for (int i = 0, ans = 0; i < n; ++i) {
			cin >> tmp;
			ans += (i < (n-k)) ? tmp : x;
		}
		cout << ans << endl;
	}
	return 0;
}

#include<iostream>
using namespace std;
int main(){
	int n,k,x;
	cin>>n>>k>>x;
	int a,s[101]={0};
	for(int i=0;i<n;i++){
		cin>>a;
		s[a]++;
	}
	int ans=0,ct=0;
	for(int i=0;i<101;++i){
		if(ct<k-s[i]&&s[i]!=0) ans+=i*s[i], ct+=s[i];
		else if(ct<k&&s[i]!=0) ans+=i, ct+=1,s[i]--,i--;
		else if(s[i]!=0) ct+=s[i];
	}
	cout<<ans+(ct-k)*x<<endl;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

main(){
int n, k, x, resultado;
cin >> n>> k>>x;
cout << endl;
int AN[n];
for( int i=0; i<n; i++ ){
 cin>> AN[i];
}
resultado = k*x;
 for ( int i=0; i<k; i++ ){
  resultado = resultado + AN[i];
 }
 cout << resultado;
return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
	int n, k, x;
	scanf("%d %d %d", &n, &k, &x);
	vector <int> v(n);
	for (int i = 0; i < n; i++){
		scanf("%d", &v[i]);
	}
	int ans = 0;
	for (int i = 0; i < k; i++){
		ans += v[i];
	}
	for (int i = k; i < n; i++){
		ans += x;
	}
	printf("%d\n", ans);
	return 0;
}

#include <iostream>
#include <vector>
using namespace std;

int main() {
	int n, k, x;
	cin >> n >> k >> x;
	vector<int>a(n, 0);
	for (int i = 0; i != n; i++) {
		cin >> a[i];
	}
	int i = 0;
	int ans = 0;
	for (int i = 0; i != n - k; i++) {
		ans += a[i];
		i++;
	}
	int sum = 0;
	for (int i = (n - k - 1); i != n; i++) {
		sum += a[i];
	}
	if (sum > (n - k)*x)
		ans += (n - k)*x;
	else
		ans += sum;
	cout << ans;
	return 0;
}

#include <iostream>
#include <assert.h>
#include<string>
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
using namespace std;

int main()
{
 int n,k,x,ans=0;
 cin>>n>>k>>x;
 int i1[n];
 vector<int>ans1;
 for(int i=0;i<n;i++)
 {
    cin>>i1[i];
 }
 i1[n-1]=x;
    i1[n-2]=x;
 for(int i=0;i<n;i++)
    ans+=i1[i];
 cout<<ans;
 }

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,x,p,q,ans=0,cnt=0;;
    cin>>n>>k>>x;
    int a[n+5];
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];

    }
    if(n==1) {cout<<x<<endl;
    return 0;}

    for(int i=n;i>1;i--)
    {
        if(a[i]>=a[i-1] && cnt<k)
        {
            cnt++;
            ans+=x;

        }
        else ans+=a[i];
    }
    cout<<cnt<<endl;
    if(cnt<k && a[1]<=a[2]) ans+=x;
    else ans+=a[1];
    cout<<ans<<endl;
}

#include <iostream>
using namespace std;
int a[100],k,x,i,t,w,n,p;
int main()
{
    cin>>n;
    cin>>p;
    cin>>x;
    for(i=1; i<=n; i++)
    cin>>a[i];
    for(i=1; i<=n; i++)

                               w=w+a[i];

    t=a[n];
k=a[n-1];

                               w=w-t-k+p*x;
                               cout<<w;
                               }

#include <bits/stdc++.h>
using namespace std;
int n, k, x, a[101], pre[101], i, j, ans;
int main()
{
    cin>>n>>k>>x;
    for (i=0;i<n;i++)
        cin>>a[i];
    if (n==1)
    {
        cout<<min(a[0], x)<<endl;
        return 0;
    }
    pre[0]=a[0];
    for (i=1;i<n;i++)
        pre[i]+=pre[i-1]+a[i];
    ans+=min(k*x, pre[n-1]-pre[n-k]);
    ans+=pre[n-k-1];
    cout<<ans<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define pb push_back
#define mp(x,y) make_pair(x,y)
#define scd(n) scanf("%d",&n)
#define sclf(n) scanf("%lf",&n)
#define scl(n) scanf("%I64d",&n)
#define repi(a,b,c) for(int i=a;i<b;i+=c)
#define repis(a,b,c) for(int i=a-1;i>=b;i-=c)
#define repj(a,b,c) for(int j=a;j<b;j+=c)
#define repjs(a,b,c) for(int j=a-1;j>=b;j-=c)
#define repk(a,b,c) for(int k=a;k<b;k+=c)
#define repks(a,b,c) for(int k=a-1;k>=0;k-=c)
#define fi first
#define se second

/*
 fast I/O

 ios::sync_with_stdio(0);
 cin.tie();

 freeopen

 freopen("input.txt","r",stdin);
 freopen("output.txt","w",stdout);
 */

typedef pair<ll,ll> ii;
const int mx = 200100;
const int md = 1e9+7;
const double EULER = 2.71828182845904523536;

int main() {
    int n,x,k,arr[mx],ans=0,y;
    cin >> n >> x >> k;
    repi(0,n,1) {
        cin >> y;
        if(i < n-k) ans += y;
        else ans += k;
    }
    cout << ans << endl;
}

#include <iostream>

using namespace std;

int main()
{
    int n , k , x , res = 0 , a ;
    cin>>n>>k>>x ;

    for(int i = 1 ; i <= n ; ++i)
    {
       cin>>a ;
       if(i > n-2 && x < a)
        res += x ;
       else
        res += a ;
    }
    cout<<res;
    return 0 ;
}

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n, k, x;
    vector<int> chores;
    scanf("%d %d %d", &n, &k, &x);
    for(int i = 0; i < n; i++){
	int ch;
	cin >> ch;
	chores.push_back(ch);
    }

    sort(chores.begin(), chores.end(), greater<int>());

    for(int i = 0; i < k; i++) {
	chores[i] = x;
    }
    int sum;
    for(int i = 0; i < chores.size(); i++) {
	sum += chores[i];
    }

    cout << sum << endl;

}

#include<iostream>
#define int long long
using namespace std;
void main(){
	int n, k, x;
	cin >> n >> k >> x;
	int *num = new int[n];
	for (int i = 0; i < n; i++)
		cin >> num[i];
	int *maxn = new int[k];
	int ptr = 0;
	int temp = 0;
	int pt = 0;
	if (k == n){
		cout << k * x;
		return;
	}
	for (int i = 0; ptr < k; i++){
		if (num[i] > temp){
			temp = num[i];
			pt = i;
		}
		if (i == n - 1){
			maxn[ptr] = temp;
			temp = 0;
			ptr++;
			i = 0;
			num[pt] = 0;
		}
		cout << num[i] << endl;
	}
	int res = k * x;
	for (int i = 0; i < n; i++){
		res += num[i];
	}
	cout << res;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    cin.tie(0);
    cout.tie(0);
    int n , res = 0  ;
    string s ;
    cin>>n;
    cin>>s ;
    for(int i = 0 ; i < n ; ++i)
    {
      int z = 0 , o = 0 ;
       for(int j = i ; j < n ; ++j)
       {
          if(s[j] == '0')
           z++;
          else
           o++;
           if(o == z)
            res = max(res , j-i+1);
          if(abs(z - o) > (n - j))
           break;
       }
    }
    cout<<res;
    return 0 ;
}

/**OOO**/
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mem(x,y) memset(x,y,sizeof(x))

using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);

int n,k,x;
cin>>n>>k>>x;
    int arr[n+5];
    int total=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
    }

    for(int i=0;i<n-k;i++)
    {
        total=total+arr[i];
    }

    int temp=0;
    for(int i=0;i<k;i++)
    {
        temp=temp+x;
    }
    //cout<<total<<endl;
    //cout<<temp<<endl;

    cout<<total+temp<<endl;

return 0;
}

#include <iostream>

using namespace std;

int main()
{
    long long n,a,sum=0;
    cin>>n;
    for(long long i=1;i<=n;i++){
        cin>>a;
        sum+=a;
    }
    long long maxim1=-1,maxim2=-1;
    for(long long i=1;i<=n;i++){
        cin>>a;
        if(maxim1>a){
            if(maxim2<a){
                maxim2=a;
            }
        }
        else{
            maxim2=maxim1;
            maxim1=a;
        }
    }
    if(sum<=maxim1+maxim2){
        cout<<"YES";
    }
    else
    cout<<"NO";
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a[101];
int main()
{
	int ans;
	int n,k,x;
	cin>>n>>k>>x;
	for(int i=1;i<=n;i++)
		cin>>a[i],ans+=a[i];
	sort(a,a+n);
	for(int i=n;i>n-k;i--)
	{
		if(a[i]>x)
		{
			ans-=a[i];
			ans+=x;
		}
	}
	cout<<ans;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main()
{

int n,k,x;
int sum=0;
std::vector<int> v(n);
for(int i=0;i<n;i++)
{
	cin>>v[i];
}
for(int i=1;i<n-k;i++) sum+=v[i];
sum+=k*x;
cout<<sum;

return 0;
}

//\\/\\//\\//\\//\\//\\//\\//\\
\\//\\//\\//\\//\\//\\//\\//\\//
//     SIDDHARTHA BALUSU      \\
\\------IIT----ISM----------- //
//\\/\\//\\//\\//\\//\\//\\//\\
\\//\\//\\//\\//\\//\\//\\//\\//

#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()

#define ll long long
#define ld long double
#define pii pair<int,int>
#define umap unordered_map<int,int>

#define endl '\n'
#define LEFT(i) i<<1
#define RIGHT(i) (i<<1)+1
#define LOOP(i,a,n) for(i=a; i<n; ++i)

#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

template<typename T>
T input(){
    T ans=0,m=1;
    char c = ' ';
    while(!((c>='0' && c<='9') || c=='-')){
        c = getchar();
    }
    if(c == '-')
        m=-1 , c = getchar();
    while(c>='0' && c<='9'){
        ans = ans*10 + (c-'0');
        c = getchar();
    }
    return ans*m;
}
template<typename T> void read(T& a){a = input<T>();}
template<typename T> void read(T& a, T& b){read(a),read(b);}
template<typename T> void read(T& a, T& b, T& c){read(a,b),read(c);}
template<typename T> void read(T& a, T& b, T& c, T& d){read(a,b),read(c,d);}

template<typename T>
void amax(T& x, T y){
    x = max(x,y);
}
template<typename T>
void amin(T& x, T y){
    x = min(x,y);
}
const int inf = 2147483647;
const int mod = 1e9+7;
const int AMAX = 1e5 +5;
int main()
{
    fast_io;
    register int i,j,k;

    // -------------------------------------------------------------------------------------------------------------------------//

int n,x;
int a[200];
read(n,k,x);
LOOP(i,0,n)
cin>>a[i];
int ans=0;
if(n<=k)
cout<<(n*x)<<endl;
else{
	ans=k*x;
	for(i=0;i<n-k;i++)
	ans+=a[i];
	cout<<ans<<endl;
}

    return 0;
}

#include <bits/stdc++.h>
#define pb push_back
#define sz(x) x.size()
#define F first
#define S second
#define mp make_pair
#define ll long long
#define sqr(x) ((x)*(x))
#define inf 1e18
using namespace std;
    ll a[2000010], d[2000010];
    ll b[200010], f[1010][1010];
    ll mn=inf, mx=-inf, ans, sm=1, cnt, n, m, cur;
    bool ok, u[1000010], uu[310][310];
    char c[510][510], cc[100010];
    int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
    vector <ll> g[900010];

int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

    cin>>n;
    string s;
    cin>>s;
    map <ll, ll> mpp;
    mpp[0]=0;
    for(int i=1;i<=n;i++){
    	if(s[i-1]=='1'){
    		cnt++;
    	}
    	else{
    		cnt--;
    	}
    	if(mpp.count(cnt)){
    		ans=max(ans, i*1LL-mpp[cnt]);
    	}
    	else{
    		mpp[cnt]=i;
    	}
    }
    cout<<ans;

	return 0;
}

//#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
//#include<windows.h>
using namespace std;//-48
ifstream fin("input.txt");
ofstream fout("output.txt");

int main(){
	int n,k,x;
	vector<int> chores;
	int i;
	int c;

	fin>>n>>k>>x;
	for(i=0;i<n;i++){
		fin>>c;
		chores.push_back(c);
	}
//	sort(chores.begin(),chores.end());
	c=0;
	for(i=n-1;i>=0;i--){
		if(k>0){
			c+=x;
			k--;
		}
		else
			c+=chores[i];
	}

	fout<<c;
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n, k, x;
    vector<int> chores;
    cin >> n >> k >> x;

    for(int i = 0; i < n; i++){
	int ch;
	cin >> ch;
	chores.push_back(ch);
    }

    sort(chores.begin(), chores.end(), greater<int>());

    for(int i = 0; i < k; i++) {
	chores[i] = x;
    }
    int sum;
    for(int i = 0; i < chores.size(); i++) {
	sum += chores[i];
    }

    cout << sum << endl;

}

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <numeric>
#include <bitset>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <utility>   // std::pair, std::make_pair
#include <stdlib.h>  //atoi
#include <stdlib.h>  //atol
using namespace std;
typedef long long ll;
const  double PI = 3.141592654;
#define rep(i,x) for(ll(i)=0;(i)<(ll)(x);(i)++)
#define all(s)      (s).begin(),(s).end()
#define allv(v)      (v).begin(),(v).end()
#define pb          push_back
#define sz          s.size()
void fast()
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL), cout.tie(NULL);
}
int main()
{
	fast();
	int a, b, c, sum = 0, n, m;
	cin >> a >> b >> c;
	n = b;
	m = a - b;
	for (int i = 0; i < m; i++)
	{
		int m;
		cin >> m;
		sum += m;
	}
	a = a - n;
	while (a--)
	{
		sum += c;
	}
	cout << sum << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n,k,x;
    cin>>n>>k>>x;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a,a+n);
    int time=0;
    for(int i=0;i<k;i++){
        time+=a[i];
    }
    time+=(k*x);
    cout<<time<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{

	int n,k,x, sum = 0;

    int a[200];

    cin >> n >> k >> x;
	for(int j = 0; j<n; j++){

    	cin >> a[j];

	}

    for (int p = 0; p<(n-k-1); p++){

        	sum = sum+a[p];

    	}

   	sum = sum + (k * x);

    cout << sum;

    return 0;

}

#include<bits/stdc++.h>
#define ll long long int
#define r_0 return 0
#define fr first
#define sc second
#define pb push_back
#define sz size()
#define TIME ios_base::sync_with_stdio(0)
using namespace std;
ll n,l,m,k,one=1,mx,mn,x,y;
ll sum,cnt,ans;
char c,ch;
bool b,boo;
int a[1001][1001];
string s1,s2,s3,s;
set < int > se;
set < string > st;
vector< int > v;
vector <int > vv;
float f,fl,flo;
double doubl;
int main()
{
    cin >> n >> m >> l;
    for( int i = 0; i < n ; i ++ ){
        cin >> k;
        v.pb(k);
    }
    sort ( v.begin() , v.end() );
    for( int i = m ; i > 0; i -- ){
        cnt = v[m];
        ans = v[m+1];
    }
    for( int i = 0; i < n - m  ; i ++ ){
                sum += v[i];
    }
    cout << sum + l + l ;
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n, volume = 0;
	string s;
	vector<int> a;
	cin >> n;
	getline(cin, s);
	getline(cin, s);
	for(int i = 0; i < s.size(); i ++)
	{
		if(s[i] == ' ')
		{
			a.push_back(volume);
			volume = 0;
			continue;
		}

		if(int(s[i]) >= int('A') && int(s[i]) <= int('Z'))
		{
			volume ++;
		}
	}
	a.push_back(volume);
	int max = a[0];
	for(int i = 0; i < a.size(); i ++)
	{
		if(a[i] > max)
		{
			max = a[i];
		}
	}
	cout << max << '\n';

}

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{//hjklkjhghjkjhg
    int n,k,x,a,i;
    cin>>n,k,x;
    x = k*x;
    for(i=0; i<n-k; i++){
    cin>>a;
    x += a;
    }
    cout<<x;
}

#include <bits/stdc++.h>
/*#include<iostream.h>*/
using namespace std;
int main()
{
    long long b,n,k,x;
    cin>>n>>k>>x;
    for(long long j=0;j<n-k;j++){
        long long a;
        cin>>a;
        b=b+a;
    }
    b=b+k*x;
    cout<<b;
    return 0;
}

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>

using namespace std;

int main() {
    int n, k, x, t, s(0);
    cin >> n >> k >> x;
    while (n--) {
        cin >> t;
        s += t;
        if (n == k) break;
    }
    cout << s + k * x << '\n';
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define st(v) sort(v.begin(),v.end())
#define fd(s,x) s.find(x)!=s.end()
#define ft(x,i) for (int i=0;i<x;i++)
#define tft(x,l,i) for (int i=l;i<x;i++)
#define ftb(x,i) for (int i=x-1;i>=0;i--)
using namespace std;

int main()
{
    ll n,k,x; cin>>n>>k>>x;
    ll ered=0,id;
    ft (n,i)
    {
        cin>>id;
        ered+=((i<n-k)?id:k);
    }
    cout<<ered<<endl;
    return 0;
}

#include <iostream>
using namespace std;

int main() {
int n,k,x,a,total;

cin>>n>>k>>x;
for(int i=0;i<n;i++){
	cin>>a;
	if(i>=k){
		a=x;
	}
	total+=a;
}
cout<<total;
return 0;
}

#include<bits/stdc++.h>
using namespace std;

int k,n,x,a,ans;

int main(){
	cin >> k >> n >> x;
	for(int i=0;i<k;i++){
		cin >> a;
		if(k-n<=i && a>x) ans+=x;
		else ans+=a;
		cout << ans << '\n';
	}
	cout << ans << '\n';
}

#include <iostream>
#include <vector>
using namespace std;
int main() {
    int n;
    int k, x;
    cin >> n >> k >> x;
    vector<int> a;
    for (int i = 0; i < n; ++i) {
        int tem;
        cin >> tem;
        a.push_back(tem);
    }
    int l = 0;
    for (int i = n - 1; i >= 0 && l < k; --i, ++l) {
        if (a[i] >= x)
            a[i] = x;
        else
            break;
    }
    int sum = 0;
    for (int i = 0; i < n; ++i) {
        cout << a[i] << " ";
        sum += a[i];
    }
    cout << sum << endl;
}

#include<bits/stdc++.h>
using std::vector;
using std::pair;
using lint = long long int;
using pii = std::pair<int, int>;

int arr[110];
int main(void){
	int n, k, x;
	scanf("%d%d%d", &n, &k, &x);
	for (int i = 0; i < n; i++) {
		scanf("%d", &arr[i]);
	}
	for (int i = 0; i < n; i++) {
		arr[n - 1 - i] = x;
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		ans += arr[i];
	}
	printf("%d", ans);
	return 0;
}

#include <iostream>
using namespace std;
int n,k,x,i,s;
int t[101];
main () {
	cin>>n>>k>>x;
	for(i=1;i<n;i++) {
		cin>>t[i];
		if (i<=n-k) s=s+t[i];
		else s=s+x;
	}
	cout<<s<<endl;
}

/*  */
 #include <iostream>
 #include<algorithm>
 #define MAXN 100010

 int N, K, X, sol = 0;
 int A[MAXN];

 main(void){
    freopen("a.in", "r", stdin);

    scanf("%d%d%d", &N, &K, &X);
    for(int i=1; i<=N; i++)
        scanf("%d", &A[i]);

    for(int i=1; i<=N-K; i++)
        sol += A[i];

    printf("%d\n", sol + K*X);

    return 0;
}

#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
using namespace std;

typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int dp[MAXN<<1],par[MAXN];
char s[MAXN];
int main(){
	//~ freopen("file.in","r",stdin);
	int n,ans=0;
	scanf("%d%s",&n,s+1);
	for(int i=0;i<=n*2;i++)
		dp[i]=INF;
	dp[n]=0;
	for(int i=1;i<=n;i++){
		if(s[i]=='0')
			par[i]=par[i-1]-1;
		else
			par[i]=par[i-1]+1;
		umax(ans,i-dp[par[i]+n]);
		umin(dp[par[i]+n],i);
	}
	printf("%d\n",ans);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,k,x,ans=0,i,t;
	cin>>n>>k>>x;
	for(i=0;i<n-x;i++)
	{
		cin>>t;
		ans=ans+t;
	}
	ans=ans+k*x;
	cout<<ans;
}

#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
//#include<>
using namespace std;
int main(){
	int s=0,n,x,k,a[100000],i,j;
	cin>>n>>k>>x;
	for(i=0;i<n;i++){
		cin>>a[i];
	}
	for(i=k;i<n;i++){
		if(a[i]>=x) a[i]=x;
		s+=a[i];
		cout<<a[i]<<"\n";
	}
	for(i=0;i<k;i++){
		//if(a[i]>=x) a[i]=x;
		s+=a[i];
		cout<<a[i]<<"\n";
	}
	cout<<s;
	//system("pause");
}

#include <cstdio>
#include <algorithm>
#include <set>

using namespace std;

int main() {
    int n = 0, m = 0;
    scanf("%d %d", &n, &m);
    set<int> a, b;
    int buf = 0;
    for (int i = 0; i < n; i++) {
        scanf("%d", &buf);
        a.insert(buf);
    }
    int ans = 10;
    for (int i = 0; i < m; i++) {
        scanf("%d", &buf);
        b.insert(buf);
        if (a.count(buf) > 0) {
            ans = min(ans, buf);
        }
    }
    if (ans < 10) {
        printf("%d\n", ans);
    } else {
        int x = *a.begin(), y = *b.begin();
        /*
        int ans = 100;
        if (x == 0) {
            ans = y * 10;
            a.erase(x);
        } else if (y == 0) {
            ans = x * 10;
            b.erase(y);
        }
        x = *a.begin();
        y = *b.begin();
        */
        printf("%d\n", min(x * 10 + y, y * 10 + x));
    }
    return 0;
}

#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
int a[105];
int main() {
	int n, k, x, count = 0;
	cin >> n >> k >> x;
	for(int i = 1; i <= n; i++) {
		cin >> a[i];
		if(a[i] > 2)
			count++;
	}
	int ans = 0;
	for(int i = 1; i <= n - min(count, k); i++)
		ans += a[i];
	ans += min(count, k) * x;
	cout << ans << endl;
	return 0;
}

/**OOO**/
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define mem(x,y) memset(x,y,sizeof(x))

using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);

int n,k,x;
cin>>n>>k>>x;
    int arr[n+5];
    int total=0;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&arr[i]);
        total=total+arr[i];
    }

    int j=n-1;
    for(int i=0;i<k;i++)
    {
        if(x<=arr[j])
        {
            total=(total-arr[j])+x;
        }
        j--;
    }
    cout<<total<<endl;

return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n,k,x;
  cin>>n>>k>>x;
  int a[n],sum=2*x;
  for (size_t i = 0; i < n; i++) cin>>a[i];
  for (size_t i = 0; i < n-k; i++) sum+=a[i];
  cout<<sum;
}

#include<iostream>
#include<cmath>
#include<cstring>
#include<iomanip>
int counter;
using namespace std;
int main() {
    char x[1001],y[1001],z[1001];
    cin>>x>>y;
    int g = strlen(x)-1;
    for(int i = 0;i<strlen(x);i++){
        for(g;g>=0;g--){
            z[i] = x[g];
            break;
        }
        g--;
    }
    for(int i = 0;i<strlen(x);i++){
        if(z[i] == y[i]){cout<<"YES"<<endl;break;}
        else     {cout<<"NO"<<endl;break;}
    }
    return 0;

}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int x, y, z, A[109];
    int chor = 0;
    scanf("%d",&x, &y, &z);
    for(int i = 0; i < x ;i ++)
    {
        scanf("%d", &A[i]);
    }
    for(int i = 0; i < x - y - 1 ; i++)

        chor += A[i];

    chor += (y * z);
    printf("%d", chor);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main(){
	int n,x,k;
	int arr[n];
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	int i = n-1;
	int total = 0 ;
	while(x--){
		total += k;
		i--;
	}i++;
	while(i--){
		total += arr[i];
	}cout<<total;
	return 0;
}