#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, i;
  scanf("%lld", &n);
  scanf("%lld", &m);
  scanf("%lld", &k);
  long long int a[n], index[100005];
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    index[a[i]] = i;
  }
  long long int x, sum = 0;
  for (i = 0; i < m; ++i) {
    scanf("%lld", &x);
    sum += ((index[x] / k) + 1);
    if (index[x] != 0) {
      long long int r = a[index[x]], s = a[index[x] - 1];
      long long int temp = a[index[x]];
      a[index[x]] = a[index[x] - 1];
      a[index[x] - 1] = temp;
      temp = index[r];
      index[r] = index[s];
      index[s] = temp;
    }
  }
  cout << sum << endl;
  return 0;
}
