#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, m, k, i, p, pos, sum = 0, j, a;
  cin >> n >> m >> k;
  for (i = 0; i < k; i++) {
    cin >> p;
    v.push_back(p);
  }
  vector<int>::iterator it;
  for (i = 0; i < n * m; i++) {
    cin >> pos;
    for (j = 0; j < v.size(); j++) {
      if (v[j] == pos) {
        a = j + 1;
        break;
      }
    }
    sum += a;
    it = v.begin();
    v.insert(it, 1, pos);
    it = v.begin() + a;
    v.erase(it, it + 1);
  }
  cout << sum << endl;
  return 0;
}
