#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, k, sum = 0;
  cin >> n >> m >> k;
  long long int arr[n + 1], p[n + 1];
  memset(p, 0, sizeof(p));
  for (long long int i = 0; i < n; i++) {
    long long int tt;
    cin >> tt;
    p[tt] = i + 1;
    arr[i + 1] = tt;
  }
  for (long long int i = 0; i < m; i++) {
    long long int t;
    cin >> t;
    long long int p1 = arr[p[t] - 1], p2 = arr[p[t]];
    if (p[t] == 1)
      sum += 1;
    else {
      if (p[t] % k > 0)
        sum += (p[t] / k) + 1;
      else
        sum += (p[t] / k);
      swap(arr[p[t]], arr[p[t] - 1]);
      p[p1]++;
      p[p2]--;
    }
  }
  cout << sum << endl;
  return 0;
}
