#include <bits/stdc++.h>
using namespace std;
const long long N = 5000 + 11;
long long dp[N][N], a[N], b[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k;
  cin >> n >> k >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    b[i] = b[i - 1] + a[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) {
      dp[i][j] = dp[i - 1][j];
      if (i >= k) dp[i][j] = max(dp[i][j], dp[i - k][j - 1] + b[i] - b[i - k]);
      ans = max(ans, dp[i][j]);
    }
  cout << ans << endl;
}
