#include <bits/stdc++.h>
using namespace std;
long long a[5000 + 1];
long long dp[5000 + 1][5000 + 1];
int main() {
  int N, K, X, n, x, i;
  long long ans;
  scanf("%d%d%d", &N, &K, &X);
  for (n = 1; n <= N; n++) {
    scanf("%lld", a + n);
  }
  for (n = 0; n <= N; n++) {
    for (x = 0; x <= X; x++) {
      dp[n][x] = -0x3f3f3f3f3f3f3f3fll;
    }
  }
  dp[0][0] = 0;
  for (x = 1; x <= X; x++) {
    for (n = 1; n <= N; n++) {
      for (i = max(0, n - K); i <= n - 1; i++) {
        dp[n][x] = max(dp[n][x], dp[i][x - 1] + a[n]);
      }
    }
  }
  ans = -0x3f3f3f3f3f3f3f3fll;
  for (n = N - K + 1; n <= N; n++) {
    ans = max(ans, dp[n][X]);
  }
  printf("%lld\n", ans <= 0 ? -1 : ans);
  return 0;
}
