from collections import deque n, m, k = map(int, input().split()) c = [*map(int, input().split())] a = [*map(int, input().split())] b = [deque() for _ in range(m)] ans = 10 ** 20 for i, v in enumerate(c): b[v - 1].append(i) if i >= k: if b[v - 1][0] <= i - k: b[v - 1].popleft() ans = min(ans, (k - len(b[v - 1])) * a[v - 1]) print(ans)