#include <bits/stdc++.h>
using namespace std;
const double esp = 1e-5;
int n, m, k;
int ki[100010], ik[100010];
int main(int argc, char *argv[]) {
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    int u;
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &u);
      ki[u] = i;
      ik[i] = u;
    }
    long long ans = 0;
    for (int i = 1; i <= m; ++i) {
      scanf("%d", &u);
      ans += (ki[u] - 1) / k + 1;
      if (ki[u] != 1) {
        int pos = ki[u];
        int tmp = ik[pos - 1];
        ki[u] = pos - 1;
        ki[tmp] = pos;
        ik[pos - 1] = u;
        ik[pos] = tmp;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
