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