#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e3 + 3;
int n, k, m;
long long p;
long long sum[maxn], help[maxn], dp[maxn][maxn];
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> p;
    sum[i] = sum[i - 1] + p;
  }
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= m; j++) {
      for (int z = 1; z <= n; z++) {
        if (i * j > z) continue;
        help[z - 1] > sum[z] - sum[z - j] + dp[j][z - j]
            ? help[z] = help[z - 1]
            : help[z] = sum[z] - sum[z - j] + dp[j][z - j];
      }
      for (int z = 1; z <= n; z++) dp[j][z] = help[z];
    }
  }
  cout << dp[m][n] << endl;
  return 0;
}
