#include <bits/stdc++.h>
using namespace std;
void solve(int n) {
  int m, k;
  scanf(" %d %d", &m, &k);
  vector<int> pos(n + 1);
  vector<int> onpos(n + 1);
  int a;
  for (int i = 1; i <= n; i++) {
    scanf(" %d", &a);
    onpos[i] = a;
    pos[a] = i;
  }
  int b;
  long long ans = 0;
  for (int it = 0; it < m; it++) {
    scanf(" %d", &b);
    ans += (pos[b] - 1) / k;
    ans += 1;
    if (pos[b] != 1) {
      int val = pos[b];
      swap(onpos[val], onpos[val - 1]);
      pos[onpos[val]] = val;
      pos[onpos[val - 1]] = val - 1;
    }
  }
  cout << ans << endl;
}
int main() {
  int n;
  while (cin >> n) solve(n);
}
