#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
ll n,k,*arr,m,**dp;
ll foo(ll s,ll c){
if(s>=n){return INT_MAX;}
//if(c==m){return m*k;}
if(c>=m){return -1;}
if(dp[s][c]!=-1){return dp[s][c];}
if(arr[s]==1){
if(c==0){return dp[s][c]=1+min(foo(s+1,c+1),foo(s+1,c));}
return dp[s][c]=min(c*k+foo(s+1,c+1),c*k+foo(s+1,c));
}
else{
if(c==0){return dp[s][c]=1+foo(s+1,c);}
else{return dp[s][c]=c*k+foo(s+1,c);}
}
}
int main() {
ll cnt=0,a1,a2;
cin>>n>>m>>k;
dp=(ll **)malloc(n * sizeof(ll *));
for(a1=0;a1<n;++a1){
dp[a1]=(ll *)malloc(sizeof(ll)*m);
}
for(a1=0;a1<n;++a1){
for(a2=0;a2<m;++a2){
dp[a1][a2]=-1;
}
}
arr=(ll *)malloc(n*sizeof(ll));
for(a1=0;a1<n;++a1){
cin>>arr[a1];
if(arr[a1]==1){++cnt;}
}
if(cnt<m){cout<<-1;return 0;}
cout<<foo(0,0);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgbXAgbWFrZV9wYWlyCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgbG9uZyBsb25nIGxsOwpsbCBuLGssKmFycixtLCoqZHA7CmxsIGZvbyhsbCBzLGxsIGMpewogICAgaWYocz49bil7cmV0dXJuIElOVF9NQVg7fQogICAgLy9pZihjPT1tKXtyZXR1cm4gbSprO30KICAgIGlmKGM+PW0pe3JldHVybiAtMTt9CiAgICBpZihkcFtzXVtjXSE9LTEpe3JldHVybiBkcFtzXVtjXTt9CiAgICBpZihhcnJbc109PTEpewogICAgICAgICAgICBpZihjPT0wKXtyZXR1cm4gZHBbc11bY109MSttaW4oZm9vKHMrMSxjKzEpLGZvbyhzKzEsYykpO30KICAgICAgICAgICAgcmV0dXJuIGRwW3NdW2NdPW1pbihjKmsrZm9vKHMrMSxjKzEpLGMqaytmb28ocysxLGMpKTsKICAgIH0KICAgIGVsc2V7CiAgICAgICAgaWYoYz09MCl7cmV0dXJuIGRwW3NdW2NdPTErZm9vKHMrMSxjKTt9CiAgICAgICAgZWxzZXtyZXR1cm4gZHBbc11bY109YyprK2ZvbyhzKzEsYyk7fQogICAgfQp9CmludCBtYWluKCkgewogICAgbGwgY250PTAsYTEsYTI7CiAgICBjaW4+Pm4+Pm0+Pms7CiAgICBkcD0obGwgKiopbWFsbG9jKG4gKiBzaXplb2YobGwgKikpOwogICAgZm9yKGExPTA7YTE8bjsrK2ExKXsKICAgICAgICBkcFthMV09KGxsICopbWFsbG9jKHNpemVvZihsbCkqbSk7CiAgICB9CiAgICBmb3IoYTE9MDthMTxuOysrYTEpewogICAgICAgIGZvcihhMj0wO2EyPG07KythMil7CiAgICAgICAgICAgIGRwW2ExXVthMl09LTE7CiAgICAgICAgfQogICAgfQogICAgYXJyPShsbCAqKW1hbGxvYyhuKnNpemVvZihsbCkpOwogICAgZm9yKGExPTA7YTE8bjsrK2ExKXsKICAgICAgICBjaW4+PmFyclthMV07CiAgICAgICAgaWYoYXJyW2ExXT09MSl7KytjbnQ7fQogICAgfQogICAgaWYoY250PG0pe2NvdXQ8PC0xO3JldHVybiAwO30KCWNvdXQ8PGZvbygwLDApOwoJcmV0dXJuIDA7Cn0K