#include <bits/stdc++.h>
using namespace std;
long long int ans;
map<int, int> m1, m2;
int main() {
  int i, n, m, k, a, x, vala, valx;
  cin >> n >> m >> k;
  for (i = 0; i < n; i++) {
    cin >> x;
    m1[i] = x;
    m2[x] = i;
  }
  for (i = 0; i < m; i++) {
    cin >> x;
    if (!m2[x]) {
      ans++;
      continue;
    }
    ans += (m2[x]) / k + 1;
    a = m1[m2[x] - 1];
    vala = m2[a];
    valx = m2[x];
    m1[valx] = a;
    m1[vala] = x;
    m2[a] = valx;
    m2[x] = vala;
  }
  cout << ans;
  return 0;
}
