def knapsack(N, M, W, A, B, C): dp = [0] * (W + 1) for i in range(N): for w in range(W, 0, -1): if w - 1 >= 0: dp[w] = max(dp[w], dp[w - 1] + A[i]) items = list(zip(B, C)) items.sort() for i in range(M): b, c = items[i] for w in range(W, b - 1, -1): dp[w] = max(dp[w], dp[w - b] + c) return dp[W] 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))