#include <bits/stdc++.h>
int n, m, k, ar[1010], order[1010];
int pos(int i) {
  int j;
  for (j = 1; j <= k; j++) {
    if (ar[j] == i) return j;
  }
  return -1;
}
int main() {
  long long res;
  int i, j, l, x;
  while (scanf("%d %d %d", &n, &m, &k) != EOF) {
    memset(ar, 0, sizeof(ar));
    for (i = 1; i <= k; i++) {
      scanf("%d", &ar[i]);
    }
    for (i = 0, res = 0; i < (n * m); i++) {
      scanf("%d", &x);
      l = pos(x), res += l;
      if (l == -1) __builtin_trap();
      for (j = l; j >= 2; j--) ar[j] = ar[j - 1];
      ar[1] = x;
    }
    printf("%lld\n", res);
  }
  return 0;
}
