#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int a[k + 1], b[n][m];
  for (int i = 1; i <= k; i++) cin >> a[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> b[i][j];
  int res = 0;
  for (int i = 0; i < n; i++) {
    int subres = 0;
    for (int j = 0; j < m; j++) {
      int curr = 1;
      for (int K = 1; K <= k; K++) {
        if (a[K] == b[i][j]) {
          curr = K;
          break;
        }
      }
      subres += curr;
      for (int K = curr; K > 1; K--) swap(a[K], a[K - 1]);
    }
    res += subres;
  }
  cout << res << endl;
}
