#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n;
  cin >> m;
  cin >> k;
  int arrayrep[n + 10];
  int hasher[n + 100];
  for (int i = 0; i < n; i++) {
    cin >> arrayrep[i];
    hasher[arrayrep[i]] = i;
  }
  int ope[m + 10];
  for (int i = 0; i < m; i++) {
    cin >> ope[i];
  }
  long long int ans = 0;
  for (int i = 0; i < m; i++) {
    int temp = ope[i];
    int lockerlock = hasher[temp];
    ans += lockerlock / k + 1;
    if (lockerlock != 0) {
      int pval = arrayrep[lockerlock - 1];
      int kk = arrayrep[lockerlock];
      arrayrep[lockerlock] = arrayrep[lockerlock - 1];
      arrayrep[lockerlock - 1] = kk;
      kk = hasher[temp];
      hasher[temp] = hasher[pval];
      hasher[pval] = kk;
    }
  }
  cout << ans << endl;
  return 0;
}
