#include <bits/stdc++.h>
using namespace std;
const int MM = 100100;
int opp[MM], pos[MM], n, m, k, a, t;
long long ans;
int main() {
  ans = 0;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &opp[i]);
    pos[opp[i]] = i;
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a);
    int ppos = pos[a];
    if (ppos == 1) {
      ans++;
      continue;
    }
    ans += (ppos + k - 1) / k;
    swap(pos[a], pos[opp[ppos - 1]]);
    swap(opp[ppos], opp[ppos - 1]);
  }
  printf("%lld\n", ans);
  return 0;
}
