#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  list<int> ar;
  int i, j, l, t = 0, c = 0, ans = 0;
  for (i = 1; i <= k; i++) {
    scanf("%d", &j);
    ar.push_back(j);
  }
  while (n--) {
    for (i = 1; i <= m; i++) {
      c = 0;
      scanf("%d", &j);
      for (list<int>::iterator it = ar.begin(); it != ar.end(); it++) {
        c++;
        if (j == *it) break;
      }
      ans += c;
      ar.remove(j);
      ar.push_front(j);
    }
  }
  cout << ans << endl;
  return 0;
}
