#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, post, temp;
  long long int count = 0;
  cin >> n >> m >> k;
  int a[n + 1], b[m], c[n + 1], i, j;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    c[a[i]] = i;
  }
  for (i = 0; i < m; i++) cin >> b[i];
  for (i = 0; i < m; i++) {
    post = c[b[i]];
    count += ceil((float)post / k);
    if (post != 1) {
      c[a[post - 1]]++;
      c[b[i]]--;
      temp = a[post];
      a[post] = a[post - 1];
      a[post - 1] = temp;
    }
  }
  cout << count;
  return 0;
}
