#include <bits/stdc++.h>
using namespace std;
vector<int> months = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int MAX = 1e5 + 55;
const int inf = 1e9 + 77;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
const double eps = 1e-7;
int n, m, k;
int a[MAX];
int ID[MAX];
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    ID[a[i]] = i;
  }
  long long res = 0;
  while (m--) {
    int x;
    scanf("%d", &x);
    res += ((ID[x] / k) + 1);
    int i = ID[x];
    if (i == 0) continue;
    int j = i - 1;
    ID[x]--;
    ID[a[j]]++;
    swap(a[i], a[j]);
  }
  printf("%I64d", res);
  return 0;
}
