#include <bits/stdc++.h>
using namespace std;
int a[100100], pos[100100];
long long ans;
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    pos[a[i]] = i;
  }
  for (int i = 1, x; i <= m; i++) {
    scanf("%d", &x);
    ans += pos[x] / k + (bool)(pos[x] % k);
    if (pos[x] != 1) {
      int y = a[pos[x] - 1];
      a[pos[x] - 1] = x;
      a[pos[x]] = y;
      pos[x]--;
      pos[y]++;
    }
  }
  cout << ans << endl;
  return 0;
}
