#include <bits/stdc++.h>
using namespace std;
struct node {
  int info;
  struct node *link;
};
int count(struct node *start, int i);
struct node *addatbeg(struct node *start, int data);
struct node *addatend(struct node *start, int data);
struct node *del(struct node *start, int data);
int main() {
  struct node *start = NULL;
  int n, m, k, l, i, j, q = 0, r, data;
  cin >> n >> m >> k;
  cin >> data;
  start = addatbeg(start, data);
  for (i = 1; i < k; i++) {
    cin >> data;
    start = addatend(start, data);
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> r;
      q += count(start, r);
      start = del(start, r);
      start = addatbeg(start, r);
    }
  }
  cout << q;
}
int count(struct node *start, int i) {
  struct node *p;
  int cnt = 1;
  p = start;
  while (p != NULL) {
    if (p->info == i) {
      return cnt;
    }
    p = p->link;
    cnt++;
  }
  return 0;
}
struct node *addatbeg(struct node *start, int data) {
  struct node *tmp;
  tmp = (struct node *)malloc(sizeof(struct node));
  tmp->info = data;
  tmp->link = start;
  start = tmp;
  return start;
}
struct node *addatend(struct node *start, int data) {
  struct node *p, *tmp;
  tmp = (struct node *)malloc(sizeof(struct node));
  tmp->info = data;
  p = start;
  while (p->link != NULL) p = p->link;
  p->link = tmp;
  tmp->link = NULL;
  return start;
}
struct node *del(struct node *start, int data) {
  struct node *tmp, *p;
  if (start == NULL) {
    printf("List is empty\n");
    return start;
  }
  if (start->info == data) {
    tmp = start;
    start = start->link;
    free(tmp);
    return start;
  }
  p = start;
  while (p->link != NULL) {
    if (p->link->info == data) {
      tmp = p->link;
      p->link = tmp->link;
      free(tmp);
      return start;
    }
    p = p->link;
  }
  printf("Element %d not found\n", data);
  return start;
}
