#include <bits/stdc++.h>
using namespace std;
int pos[100005], app[100005];
int main() {
  int n, m, k, launch;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> app[i];
    pos[app[i]] = i;
  }
  long long int gesture = 0;
  for (int i = 1; i <= m; i++) {
    cin >> launch;
    int p = pos[launch], temp;
    if (p != 1) {
      temp = p - 1;
      pos[launch] = temp;
      pos[app[temp]] = p;
      temp = app[p];
      app[p] = app[p - 1];
      app[p - 1] = temp;
    }
    if (p % k == 0)
      gesture += p / k;
    else
      gesture += (p / k) + 1;
  }
  cout << gesture << endl;
  return 0;
}
