#include <bits/stdc++.h>
using namespace std;
long long v[100024];
long long q[100024];
int main() {
  long long n, m;
  double k;
  cin >> n >> m >> k;
  long long num;
  for (int a = 1; a <= n; a++) {
    cin >> num;
    v[num] = a;
    q[a] = num;
  }
  long long tot = 0, pos2, num2;
  double pos;
  double pose;
  for (int a = 1; a <= m; a++) {
    cin >> num;
    pos = v[num];
    pose = ((pos) / k);
    if (pose != (long long)((pos) / k)) pose = (long long)((pos) / k) + 1;
    tot += pose;
    pos2 = pos - 1;
    if (pos2 == 0) continue;
    num2 = q[pos2];
    swap(q[(long long)pos], q[pos2]);
    swap(v[num], v[num2]);
  }
  cout << tot << endl;
}
