def knapsack(N, M, W, A, B, C): dp = {0: 0} for i in range(N): for w in sorted(dp.keys(), reverse=True): if w + 1 <= W: dp[w + 1] = max(dp.get(w + 1, 0), dp[w] + A[i]) items = [(b, c) for b, c in zip(B, C) if b <= W] items.sort() for b, c in items: for w in sorted(dp.keys(), reverse=True): if w + b <= W: dp[w + b] = max(dp.get(w + b, 0), dp[w] + c) return max(dp.values()) N, M, W = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) print(knapsack(N, M, W, A, B, C))