#include <bits/stdc++.h>
using namespace std;
map<long long, long long> appNameToIndex;
map<long long, long long> indToAppName;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m, k;
  cin >> n >> m >> k;
  long long arr[n];
  long long applicationLaunched[m];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    appNameToIndex[arr[i]] = i;
    indToAppName[i] = arr[i];
  }
  long long gestures = 0;
  for (long long i = 0; i < m; i++) {
    cin >> applicationLaunched[i];
    gestures += (appNameToIndex[applicationLaunched[i]] / k) + 1;
    long long index = appNameToIndex[applicationLaunched[i]];
    if (index > 0) {
      appNameToIndex[applicationLaunched[i]] = index - 1;
      long long appName = indToAppName[index - 1];
      appNameToIndex[appName] = index;
      indToAppName[index] = appName;
      indToAppName[index - 1] = applicationLaunched[i];
    }
  }
  cout << gestures << endl;
  return 0;
}
