#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n, k, x;
  cin >> n >> k >> x;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<vector<long long>> b(n + 1, vector<long long>(x + 1, -1));
  b[0][0] = 0;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= x; j++) {
      for (long long l = max(i - k, (long long)0); l < i; l++) {
        if (b[l][j - 1] != -1) {
          b[i][j] = max(b[i][j], b[l][j - 1] + a[i - 1]);
        }
      }
    }
  }
  long long o = -1;
  for (long long i = max(n - k + 1, (long long)0); i <= n; i++) {
    o = max(o, b[i][x]);
  }
  cout << o << endl;
  return 0;
}
