#include <bits/stdc++.h>
using namespace std;
int Loc[100001];
int Id[100001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; ++i) {
    int inp;
    cin >> inp;
    Loc[inp] = i;
    Id[i] = inp;
  }
  long long ans = m;
  for (int i = 0; i < m; ++i) {
    int inp;
    cin >> inp;
    ans += Loc[inp] / k;
    if (Loc[inp]) {
      swap(Id[Loc[inp]], Id[Loc[inp] - 1]);
      swap(Loc[inp], Loc[Id[Loc[inp]]]);
    }
  }
  cout << ans << endl;
  return 0;
}
