#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename T_container, typename T = typename enable_if<
                                    !is_same<T_container, string>::value,
                                    typename T_container::value_type>::type>
ostream &operator<<(ostream &os, const T_container &v) {
  os << '{';
  string sep;
  for (const T &x : v) os << sep << x, sep = ", ";
  return os << '}';
}
void dbg_out() { cerr << "\n"; }
template <typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
  cerr << ' ' << H;
  dbg_out(T...);
}
void solve() {
  long long n, k, x;
  cin >> n >> k >> x;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long dp[n + 1][x + 1];
  for (auto &c : dp) {
    for (auto &d : c) {
      d = -1;
    }
  }
  dp[0][0] = 0;
  long long ans = -1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= x; j++) {
      for (long long l = k; l >= 1; l--) {
        if (i - l >= 0 && dp[i - l][j - 1] != -1) {
          dp[i][j] = max(dp[i][j], dp[i - l][j - 1] + a[i - 1]);
        }
      }
    }
  }
  for (long long i = n; i > n - k; i--) {
    ans = max(ans, dp[i][x]);
  }
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
}
