#include <bits/stdc++.h>
using namespace std;
class Application {
 public:
  inline void Run();

 private:
  inline void LoadData();
  inline void Solve();
  vector<int> app_in_row_;
  vector<int> app_by_number_;
  int app_number;
  int screen_capacity;
  int orders_number_;
  unsigned long long result_;
};
int main() {
  ios_base::sync_with_stdio(false);
  Application app;
  app.Run();
}
inline void Application::LoadData() {
  cin >> app_number >> orders_number_ >> screen_capacity;
  app_by_number_.resize(app_number + 1);
  app_in_row_.resize(app_number + 1);
  for (int i = 1; i <= app_number; ++i) {
    cin >> app_in_row_[i];
    app_by_number_[app_in_row_[i]] = i;
  }
  result_ = 0;
}
inline void Application::Solve() {
  int order;
  int order_number;
  for (int i = 0; i < orders_number_; ++i) {
    cin >> order;
    order_number = app_by_number_[order];
    result_ += (order_number / screen_capacity);
    if (order_number % screen_capacity > 0) ++result_;
    if (order_number > 1) {
      swap(app_in_row_[order_number], app_in_row_[order_number - 1]);
      --app_by_number_[order];
      ++app_by_number_[app_in_row_[order_number]];
    }
  }
  cout << result_ << endl;
}
inline void Application::Run() {
  LoadData();
  Solve();
}
