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