#include <bits/stdc++.h>
using namespace std;
const long long maxn = 5000 + 10;
long long dp[maxn][maxn];
long long a[maxn];
int32_t main() {
  long long n, k, x;
  cin >> n >> k >> x;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  dp[0][0] = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = i - k; j < i; j++) {
      if (j < 0) continue;
      for (long long q = (i - 1) / k; q < x; q++) {
        if (dp[j][q] || i <= k)
          dp[i][q + 1] = max(dp[i][q + 1], dp[j][q] + a[i]);
      }
    }
  }
  long long maxn = 0;
  for (long long i = n; i >= n - k + 1; i--) {
    maxn = max(dp[i][x], maxn);
  }
  if (maxn)
    cout << maxn << endl;
  else
    cout << -1 << endl;
}
