#include <bits/stdc++.h>
using namespace std;
int N, M, K, P[105];
int main() {
  scanf("%d %d %d", &N, &M, &K);
  for (int i = 0; i < K; i++) scanf("%d", &P[i]);
  int ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      int x;
      scanf("%d", &x);
      int idx;
      for (int k = 0; k < K; k++)
        if (x == P[k]) {
          idx = k;
          break;
        }
      for (int k = idx; k > 0; k--) P[k] = P[k - 1];
      P[0] = x;
      ans += idx + 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
