#include <bits/stdc++.h>
using namespace std;
int a1[100005];
int a2[100005];
int main() {
  long long n, m, k, l = 0;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a1[x] = i;
    a2[i] = x;
  }
  for (int f = 0; f < m; f++) {
    int x;
    cin >> x;
    l += (a1[x] + k) / k;
    int aa = a1[x];
    if (aa) {
      a1[a2[aa - 1]]++;
      a1[a2[aa]]--;
      swap(a2[aa - 1], a2[aa]);
    }
  }
  cout << l << endl;
  return 0;
}
