#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, w, e, r, t, c, a[100000], s[100000];
  long long y = 0;
  cin >> q >> w >> t;
  for (e = 0; e < q; e++) {
    scanf("%d", &a[e]);
    a[e]--;
    s[a[e]] = e;
  }
  for (; w; w--) {
    scanf("%d", &e);
    e--;
    y += (s[e] / t) + 1;
    if (s[e] > 0) {
      r = s[e];
      c = a[r];
      a[r] = a[r - 1];
      a[r - 1] = c;
      s[a[r]] = r;
      s[a[r - 1]] = r - 1;
    }
  }
  cout << y;
  return 0;
}
