#include <bits/stdc++.h>
using namespace std;
int n, m, q, ans;
int v[110], k[110], x;
int main() {
  cin >> n >> m >> q;
  for (int i = 1; i <= q; i++) cin >> v[i];
  for (int i = 1; i <= n; i++) {
    for (int h = 1; h <= m; h++) {
      cin >> x;
      int p = 0;
      for (int j = 1; j <= q; j++)
        if (v[j] == x) p = j;
      ans += p;
      k[1] = v[p];
      for (int j = 1, t = 2; j <= q; j++)
        if (v[j] != x) k[t++] = v[j];
      for (int j = 1; j <= q; j++) v[j] = k[j];
    }
  }
  cout << ans;
}
