#include <bits/stdc++.h>
using namespace std;
int N, M, K, rs, x, A[101];
int poz(int a) {
  for (int i = 1; i <= K; i++)
    if (A[i] == a) return i;
  return 0;
}
int main() {
  cin >> N >> M >> K;
  for (int i = 1; i <= K; i++) cin >> A[i];
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      cin >> x;
      rs += poz(x);
      for (int i = poz(x); i > 1; i--) A[i] = A[i - 1];
      A[1] = x;
    }
  }
  cout << rs;
  return 0;
}
