#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const double pi = acos(-1.0);
int pos[100005], a[100005];
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  int n, m, k;
  while (cin >> n >> m >> k) {
    memset(pos, 0, sizeof(pos));
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      pos[a[i]] = i + 1;
    }
    int x;
    long long int ans = 0;
    for (int i = 0; i < m; i++) {
      cin >> x;
      ans += ceil((double)(pos[x]) / k);
      if (pos[x] > 1) {
        int xx = pos[x];
        pos[x]--;
        pos[a[xx - 2]]++;
        swap(a[xx - 1], a[xx - 2]);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
