{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);rep(x,n+1)rep(y,n+1)f[x+1][y]>?=s+=a[n-x]+b[n-y]>=d[s=f[x][y]],f[x][y+1]>?=s;wt(min(f[n][n],n));}