#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n;
  cin >> m;
  cin >> k;
  int t;
  pair<int, int> a[n];
  map<int, int> neha, rupsha;
  for (int i = 0; i < n; i++) {
    cin >> t;
    t--;
    a[i].second = t;
    a[i].first = i;
    neha[t] = i;
    rupsha[i] = t;
  }
  int b[m];
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  long long int ans = 0;
  for (int i = 0; i < m; i++) {
    t = b[i];
    t--;
    int index = neha[t];
    if ((index + 1) % k == 0) {
      ans += (long long int)(index + 1) / k;
    } else {
      ans += (long long int)(index + 1) / k;
      ans += 1;
    }
    if (index > 0) {
      int yu = rupsha[index - 1];
      rupsha[index] = yu;
      neha[yu] = index;
      rupsha[index - 1] = t;
      neha[t] = index - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
