#include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
int st,ed,n,sum[500001],ans=-2147483647,l=1,r=1,a[500001];
struct node
{
int num,len;
}q[500001];
int main()
{
scanf("%d%d%d",&n,&st,&ed);
for(int i=1;i<=n;i++)scanf("%d",&a[i]),sum[i]=sum[i-1]+a[i];
for(int i=1;i<=st;i++)
{
while(r>l&&q[r].num>=a[i])r--;
q[++r]=(node){a[i],i};
}
for(int i=st+1;i<=n;i++)
{
while(r>l&&q[r].num>=a[i])r--;
q[++r]=(node){a[i],i};
while(i-q[l].len>=ed)l++;
if(i-q[l].len<st-1)continue;
ans=max(sum[i]-q[l].num,ans);
}
printf("%d",ans);
return 0;
}