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