#include <bits/stdc++.h>
using namespace std;
int n, m, k, a[110];
int work() {
  int res = 0;
  for (int i = 1; i <= m; i++) {
    int x;
    scanf("%d", &x);
    int t = 1;
    while (a[t] != x && t < k) {
      t++;
    }
    res += t;
    for (int j = t; j > 1; j--) {
      a[j] = a[j - 1];
    }
    a[1] = x;
  }
  return res;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &a[i]);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += work();
  }
  cout << ans << endl;
  return 0;
}
