#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int n, m, k;
    in >> n >> m >> k;
    vector<int> p0(k);
    for (int& i : p0) in >> i;
    list<int> p(std::begin(p0), std::end(p0));
    int res = 0;
    n *= m;
    while (n--) {
      int a;
      in >> a;
      auto it = find(std::begin(p), std::end(p), a);
      res += distance(p.begin(), it) + 1;
      p.erase(it);
      p.push_front(a);
    }
    out << res << endl;
  }
};
void solve(std::istream& in, std::ostream& out) {
  out << std::setprecision(12);
  Solution solution;
  solution.solve(in, out);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  istream& in = cin;
  ostream& out = cout;
  solve(in, out);
  return 0;
}
