#include<iostream>
#include<queue>
using namespace std;
priority_queue<pair<int,int> >heap;
int n;
int f[1000000];
int d[1000000];
int t[1000000];
int ti;
int maxn=-100000;
int main(){
cin>>n;
cin>>ti;
for(int i=1;i<=n;i++){
cin>>f[i];
}
for(int i=1;i<=n;i++){
cin>>d[i];
}
for(int i=1;i<=n-1;i++){
cin>>t[i];
}
ti*=60;
int walk_time=0;
int ans=0;
for(int l=1;l<=n;l++){
if(!heap.empty()){
heap.pop();
}
for(int i=1;i<=l;i++){
heap.push(make_pair(f[i],i));
}
int T=ti-walk_time;
ans=0;
while(T>0&&heap.top().first>0){
pair<int,int>fish=heap.top();
heap.pop();
ans+=fish.first;
fish.first-=d[fish.second];
heap.push(fish);
T-=5;
}
walk_time+=t[l];
if(ans>maxn){
maxn=ans;
}
}
cout<<maxn<<endl;
}