#include <bits/stdc++.h>
using namespace std;
int id[110];
int pos[110];
int buy(int mark) {
  int res = id[mark];
  for (int i = res; i >= 2; i--) {
    pos[i] = pos[i - 1];
    id[pos[i]] = i;
  }
  pos[1] = mark;
  id[mark] = 1;
  return res;
}
int main() {
  int n, m, l, t;
  scanf("%d%d%d", &n, &m, &l);
  for (int i = 1; i <= l; i++) {
    scanf("%d", &t);
    pos[i] = t;
    id[t] = i;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      scanf("%d", &t);
      ans += buy(t);
    }
  }
  printf("%d\n", ans);
  return 0;
}
