#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 111;
int n, m, k;
int a[N];
int b;
long long ans;
int p[N], v[N];
void swap_pos(int l, int r) {
  int p1 = l, p2 = r;
  int e1 = v[p1], e2 = v[p2];
  p[e1] = p2;
  p[e2] = p1;
  v[p1] = e2;
  v[p2] = e1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    p[a[i]] = i;
    v[i] = a[i];
  }
  ans = 0;
  for (int i = 1; i <= m; i++) {
    cin >> b;
    ans += 1 + ((p[b] - 1) / k);
    if (p[b] > 1) {
      swap_pos(p[b] - 1, p[b]);
    }
  }
  cout << ans;
  return ((int)228 / 1488);
}
