#include <bits/stdc++.h>
using namespace std;
long long dp[5002][5002] = {0};
int main() {
  ios::sync_with_stdio(false);
  long long n, m, k;
  cin >> n >> m >> k;
  long long arr[n];
  for (long long lv = 0; lv < n; lv++) {
    cin >> arr[lv];
  }
  long long sum = 0;
  if (m == 1) {
    sort(arr, arr + n);
    long long lv2 = 0;
    long long ans = 0;
    for (long long lv = n - 1; lv2 < k; lv2++, lv--) {
      ans = ans + arr[lv];
    }
    cout << ans << endl;
    return 0;
  }
  for (long long lv = 0; lv < m - 1; lv++) {
    sum = sum + arr[lv];
  }
  for (long long lv = m - 1; lv < n; lv++) {
    sum = sum + arr[lv];
    sum = sum - ((lv - m >= 0) ? arr[lv - m] : 0);
    dp[lv][0] = 0;
    for (long long lv2 = 1; lv2 <= k; lv2++) {
      dp[lv][lv2] = dp[lv - 1][lv2];
    }
    for (long long lv2 = 1; lv2 <= k; lv2++) {
      dp[lv][lv2] =
          max(dp[lv][lv2], ((lv - m >= 0) ? dp[lv - m][lv2 - 1] : 0) + sum);
    }
  }
  cout << dp[n - 1][k] << endl;
  return 0;
}
