#include <bits/stdc++.h>
using namespace std;
int a[100007], b[100007], bb[100007];
long long exp(long long a, long long b, long long mod = 1e9 + 7) {
  long long tem = 1;
  while (b) {
    if (b % 2) tem = (tem * a) % mod;
    a = (a * a) % mod;
    b = b / 2;
  }
  return tem;
}
int main() {
  for (int i = 0; i < 3; i++) cin >> a[i];
  for (int i = 1; i <= a[0]; i++) {
    int tem;
    cin >> tem, b[tem] = i, bb[i] = tem;
  }
  long long ans = 0;
  for (int i = 0; i < a[1]; i++) {
    int tem;
    cin >> tem;
    ans += (b[tem] + a[2] - 1) / a[2];
    if (b[tem] != 1) {
      int temp = bb[b[tem] - 1];
      swap(bb[b[tem] - 1], bb[b[tem]]);
      b[tem]--, b[temp]++;
    }
  }
  cout << ans << "\n";
  return 0;
}
