#include <bits/stdc++.h>
using namespace std;
static const int maxn = 5000 + 5;
static const long long int inf = -1e16;
int n;
int k;
int x;
int arr[maxn];
vector<pair<int, int> > segments[maxn];
long long int dp[maxn][maxn];
long long int solve(int pos, int taken) {
  if (taken == x) {
    if (pos > n - k + 1) return 0;
    return inf;
  }
  if (taken > x or pos > n) return inf;
  long long int &ret = dp[pos][taken];
  if (~ret) return ret;
  long long int maxsum = inf;
  int maxid = pos;
  bool found = false;
  for (auto it : segments[pos]) {
    maxid = max(maxid, it.second);
    long long int go = it.first + solve(maxid + 1, taken + 1);
    if (go > maxsum) found = true, maxsum = go;
  }
  if (found == false) maxsum = inf;
  return ret = maxsum;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> k >> x;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < k and i + j <= n; j++)
      segments[i].emplace_back(arr[i + j], i + j);
  }
  memset(dp, -1, sizeof dp);
  long long int ans = solve(1, 0);
  if (ans <= 0) ans = -1;
  cout << ans << '\n';
}
