#include<queue>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define MAXN 2100
#define MAXM 12000
using namespace std;
struct na{
int y,z,f,ne;
};
int n,m,l[MAXN],r[MAXN],num=0,p,ch,ans=0,S,T,k,dis[MAXN],an=0,mi[MAXN],ro[MAXN],qi[MAXN],a,d,fa,fb,f,v;
na b[MAXM];
bool bo[MAXN];
const int INF=1e9;
queue <int> q;
inline int min(int x,int y){return x>y?y:x;}
inline int read(){
p=0;ch=getchar();
while (ch<'0'||ch>'9') ch=getchar();
while (ch>='0'&&ch<='9') p=p*10+ch-48, ch=getchar();
return p;
}
inline void spfa(){
register int i;
q.push(S);
bo[S]=1;
for (i=0;i<MAXN;i++) dis[i]=INF;
mi[S]=INF;dis[S]=0;
while(!q.empty()){
int k=q.front();q.pop();bo[k]=0;
if (k==T) continue;
for (i=l[k];i;i=b[i].ne){
if (b[i].z>0&&dis[b[i].y]>b[i].f+dis[k]){
dis[b[i].y]=b[i].f+dis[k];
mi[b[i].y]=min(mi[k],b[i].z);
ro[b[i].y]=i;
qi[b[i].y]=k;
if (!bo[b[i].y]){
bo[b[i].y]=1;
q.push(b[i].y);
}
}
}
}
}
inline int add(int x,int y,int z,int f){
num++;
if (l[x]==0) l[x]=num;else b[r[x]].ne=num;
b[num].y=y;b[num].z=z;b[num].f=f;r[x]=num;
}
inline void in(int x,int y,int z,int f){
add(x,y,z,f),add(y,x,0,-f);
}
int main(){
register int i,j;
n=read();a=read();d=read();f=read();fa=read();fb=read();
S=2*n+1;T=2*n+2;
for (i=1;i<=n;i++) v=read(),in(S,i,v,0),in(i+n,T,v,0),in(S,i+n,INF,f);
for (i=1;i<n-a;i++) in(i,i+n+a+1,INF,fa);
for (i=1;i<n-d;i++) in(i,i+n+d+1,INF,fb);
for (i=1;i<n;i++) in(i,i+1,INF,0);
for(;;){
spfa();
if (dis[T]==INF) break;
an+=mi[T]*dis[T];
for (i=T;i;i=qi[i]) b[ro[i]].z-=mi[T],b[((ro[i]-1)^1)+1].z+=mi[T];
}
printf("%d\n",an);
}