#include <bits/stdc++.h>
using namespace std;
int main() {
  long long gest = 0;
  int n, m, k;
  cin >> n;
  cin >> m;
  cin >> k;
  int a[100001], b[100001];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    b[a[i]] = i;
  }
  int x;
  for (int i = 1; i <= m; i++) {
    cin >> x;
    gest += (b[x] - 1) / k + 1;
    if (b[x] > 1) {
      swap(a[b[x] - 1], a[b[x]]);
      swap(b[x], b[a[b[x]]]);
    }
  }
  cout << gest;
  return 0;
}
