#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
const long long INFll = 1ll * INF * INF;
const int MOD = 1000000007;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> p(n + 1);
  vector<int> cur(n + 1);
  for (int i = 1; i <= n; ++i) cin >> cur[i], p[cur[i]] = i;
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    ans += p[x] / k + bool(p[x] % k);
    if (p[x] != 1) {
      int tmp = p[x];
      swap(p[x], p[cur[p[x] - 1]]);
      swap(cur[tmp], cur[tmp - 1]);
    }
  }
  cout << ans;
  return 0;
}
