#include <bits/stdc++.h>
using namespace std;
map<long long, pair<long long, pair<long long, long long> > > p;
int main() {
  long long n, m, k, a, a1, moves = 0, i;
  scanf("%lld", &n);
  scanf("%lld", &m);
  scanf("%lld", &k);
  scanf("%lld", &a);
  a1 = a;
  p[a] = make_pair(1, make_pair(-1, -1));
  for (i = 2; i <= n; i++) {
    scanf("%lld", &a);
    ;
    p[a] = make_pair(i, make_pair(a1, -1));
    p[a1].second.second = a;
    a1 = a;
  }
  for (i = 0; i < m; i++) {
    scanf("%lld", &a);
    long long pos = p[a].first;
    long long prev = p[a].second.first;
    long long next = p[a].second.second;
    if (prev != -1) {
      p[a].first = pos - 1;
      p[a].second.first = p[prev].second.first;
      p[p[prev].second.first].second.second = a;
      p[prev].first = p[prev].first + 1;
      p[prev].second.first = a;
      p[a].second.second = prev;
      p[prev].second.second = next;
      long long num = (pos - 1) / k;
      moves += num;
      if (next != -1) {
        p[next].second.first = prev;
      }
    }
    moves++;
  }
  cout << moves;
  return 0;
}
