#include <bits/stdc++.h>
using namespace std;
int p[100110];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> p[i];
  int res = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      int x;
      cin >> x;
      int pos = 0;
      while (p[pos] != x) pos++;
      res += pos + 1;
      for (int z = pos; z > 0; z--) p[z] = p[z - 1];
      p[0] = x;
    }
  cout << res << endl;
  return 0;
}
