#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, q;
  cin >> n >> m >> k;
  vector<int> a(n), p(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    p[a[i] - 1] = i;
  }
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    cin >> q;
    int pos = p[q - 1];
    ans += pos / k + 1;
    if (pos > 0) {
      swap(p[q - 1], p[a[pos - 1] - 1]);
      swap(a[pos], a[pos - 1]);
    }
  }
  cout << ans;
  return 0;
}
