#include <bits/stdc++.h>
using namespace std;
const int maxn = 200 + 5;
int a[maxn], b[maxn];
int n, m, k, x;
int getloc(int x) {
  for (int i = 1; i <= k; i++) {
    if (a[i] == x) return i;
  }
}
void update(int x) {
  int pos = 0;
  for (int i = 1; i <= k; i++) {
    if (a[i] == x) pos = i;
  }
  b[1] = a[pos];
  int t = 2;
  for (int i = 1; i <= k; i++) {
    if (i != pos) b[t++] = a[i];
  }
  for (int i = 1; i <= k; i++) {
    a[i] = b[i];
  }
}
int main() {
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    for (int i = 1; i <= k; i++) scanf("%d", &a[i]);
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        scanf("%d", &x);
        ans += getloc(x);
        update(x);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
