#include <bits/stdc++.h>
using namespace std;
double sqr(double x) { return x * x; }
double distsqr(double x, double y, double a, double b) {
  return sqr((x - a)) + sqr((y - b));
}
double cosine_angle(double a, double b, double c) {
  return (double)(sqr(a) + sqr(b) - sqr(c)) / ((double)2.0 * a * b);
}
template <class T>
T Maximum(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T Minimum(T a, T b) {
  return a < b ? a : b;
}
template <class T>
T GCD(T a, T b) {
  if (!b) return a;
  return GCD(b, a % b);
}
template <class T>
void SWAP(T &a, T &b) {
  T temp = a;
  a = b;
  b = temp;
  return;
}
template <class T>
T BigMod(T a, T n, T mod) {
  if (!n) return (T)1 % mod;
  long long int power = BigMod(a, n >> 1, mod);
  power %= mod;
  power *= power;
  power %= mod;
  if (n & 1) power *= a % mod, power %= mod;
  return power;
}
template <class T>
T ExtendedEuclid(T a, T b, T c) {
  if (!a) return 0;
  return (b * ExtendedEuclid(b % a, a, -c) + c) / a;
}
template <class T>
T ModInverse(T a, T m) {
  return ((ExtendedEuclid(a, m, (T)GCD(a, m))) % (m) + (m)) % (m);
}
int position[100010], app[100010];
int main() {
  int i, j, n, m, k, a, temp;
  long long int c;
  scanf("%d %d %d", &n, &m, &k);
  for (i = c = 0; i < n; i++) {
    scanf("%d", &a);
    app[i + 1] = a;
    position[a] = i + 1;
  }
  while (m--) {
    scanf("%d", &a);
    if (position[a] % k == 0)
      c += position[a] / k;
    else
      c += (position[a] / k) + 1;
    if (position[a] > 1) {
      i = position[a];
      j = position[a] - 1;
      SWAP(position[a], position[app[j]]);
      SWAP(app[i], app[j]);
    }
  }
  printf("%I64d\n", c);
  return 0;
}
