#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
};
long long power(long long a, long long b) {
  long long res = 1, curr = a;
  if (a == 0) return 0;
  if (b < 0) return 0;
  while (b) {
    if (b & 1) res = (res * curr) % 1000000007LL;
    curr = (curr * curr) % 1000000007LL;
    b >>= 1;
  }
  return res;
}
int main() {
  int n, lft, x, m, k, a[100010], i, pos[100010];
  long long rs = 0LL;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    pos[a[i]] = i;
  }
  while (m--) {
    scanf("%d", &x);
    rs += ((long long)pos[x] / k) + 1;
    if (pos[x] > 0) {
      lft = a[pos[x] - 1];
      pos[lft]++;
      swap(a[pos[x] - 1], a[pos[x]]);
      pos[x]--;
    }
  }
  printf("%lld\n", rs);
}
