{ll m=6010,n,a[m],b[m],d[m],f[m][m],s;rd(n,a(n+1),b(n+1),d(n));sortA(n,d);rrep(x,n+1)rrep(y,n+1){s=f[x+1][y+1];f[x][y+1]>?=s+=a[x]+b[y]>=d[s];f[x+1][y]>?=s;}wt(min(f[1][1],n));}