#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> v(k);
  for (int i = 0; i < k; ++i) {
    cin >> v[i];
  }
  int x, s = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> x;
      auto it = find(v.begin(), v.end(), x);
      auto pos = it - v.begin();
      s += pos + 1;
      v.erase(it);
      v.insert(v.begin(), x);
    }
  }
  cout << s;
  return 0;
}
