#include <bits/stdc++.h>
using namespace std;
long long arr[100005];
long long brr[100005];
int main() {
  string s, t;
  long long i, j, k, l, m, n;
  cin >> n, cin >> m, cin >> k;
  for (int i = 0; i <= n - 1; i++) {
    cin >> j;
    arr[j] = i + 1;
    brr[i + 1] = j;
  }
  long long ans = 0;
  for (int i = 0; i <= m - 1; i++) {
    cin >> j;
    ans += ((arr[j] - 1) / k);
    ans++;
    if (arr[j] != 1) {
      long long temp = brr[arr[j] - 1];
      arr[j]--;
      brr[arr[j]] = j;
      brr[arr[j] + 1] = temp;
      arr[temp] = arr[j] + 1;
    }
  }
  cout << ans << "\n";
}
