import heapq n, m, k = map(int, input().split()) c = list(map(lambda x: int(x)-1, input().split())) a = list(map(int, input().split())) d = dict() for i in range(m): d[i] = a[i] * k for i in range(k): d[c[i]] -= a[c[i]] ans = min(d.values()) # print(d) h = [] for i in d.keys(): heapq.heappush(h, m*d[i]+i) for i in range(n-k): d[c[i]] += a[c[i]] d[c[i+k]] -= a[c[i+k]] heapq.heappush(h, m*d[c[i]]+c[i]) heapq.heappush(h, m*d[c[i+k]]+c[i+k]) while h: cost, idx = divmod(heapq.heappop(h), m) if d[idx] == cost: ans = min(ans, cost) heapq.heappush(h, m*cost+idx) break print(ans)