#include using namespace std; int main() { int N, M, K; cin >> N >> M >> K; long long Ans = 1e18; vector C(N), A(M), Count(M), MaxColor(M); for (int &B : C) { cin >> B; B--; } for (int &B : A) cin >> B; for (int i = 0; i < K; i++) { Count.at(C.at(i))++; MaxColor.at(C.at(i)) = max(MaxColor.at(C.at(i)), Count.at(C.at(i))); } for (int i = K; i < N; i++) { Count.at(C.at(i - K))--; Count.at(C.at(i))++; MaxColor.at(C.at(i)) = max(MaxColor.at(C.at(i)), Count.at(C.at(i))); } for (int i = 0; i < M; i++) Ans = min(Ans, (long long)(K - MaxColor.at(i)) * A.at(i)); cout << Ans << endl; }