#include <bits/stdc++.h>
int main() {
  int num, p_man, tot;
  scanf("%d %d %d", &num, &p_man, &tot);
  int i, j, k = 0, p, pos[tot], ara[tot], da[p_man], sum = 0;
  for (i = 0; i < tot; i++) pos[i] = 0;
  for (i = 0; i < tot; i++) {
    scanf("%d", &ara[i]);
    pos[ara[i]] = k;
    k++;
  }
  for (i = 0; i < num; i++) {
    for (j = 0; j < p_man; j++) {
      scanf("%d", &da[j]);
      sum = sum + 1 + pos[da[j]];
      k = pos[da[j]];
      for (p = k; p >= 1; p--) {
        ara[p] = ara[p - 1];
        pos[ara[p]]++;
      }
      ara[0] = da[j];
      pos[da[j]] = 0;
    }
  }
  printf("%d\n", sum);
  return 0;
}
