#include <bits/stdc++.h>
using namespace std;
const int N = 500;
int n, m, k, arr[N], val, sum = 0, holder;
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= k; ++i) scanf("%d", arr + i);
  while (n--) {
    for (int i = 0; i < m; ++i) {
      scanf("%d", &val);
      int holder;
      for (int i = 1; i <= k; ++i) {
        if (arr[i] == val) {
          holder = i;
          break;
        }
      }
      sum += holder;
      while (holder - 1 > 0) {
        swap(arr[holder], arr[holder - 1]);
        holder--;
      }
    }
  }
  printf("%d", sum);
  return 0;
}
