#include <bits/stdc++.h>
using namespace std;
const int maxn = 123456;
int n, m, k;
int ai[maxn];
int bi[maxn];
void init() {
  for (int i = 1; i <= n; i++) {
    int u;
    scanf("%d", &u);
    ai[i] = u;
    bi[u] = i;
  }
}
void play() {
  int u;
  long long sum = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &u);
    int id = bi[u];
    int p = id / k;
    if (id % k != 0) p++;
    sum += p;
    if (id == 1) continue;
    int bef = id - 1;
    int v = ai[bef];
    ai[bef] = u;
    ai[id] = v;
    bi[u] = bef;
    bi[v] = id;
  }
  printf("%I64d\n", sum);
}
int main() {
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    init();
    play();
  }
  return 0;
}
