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 = [k * a[i] for i in range(m)] 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[v - 1] = min(ans[v - 1], (k - len(b[v - 1])) * a[v - 1]) print(min(ans))