#include <bits/stdc++.h>
using namespace std;
set<long long> gera_primos(long long n) {
  set<long long> primos;
  vector<bool> crivo(n);
  primos.insert(2);
  for (long long i = 3; i <= n; i += 2) {
    if (crivo[i]) continue;
    primos.insert(i);
    for (long long j = i; j <= n; j += i) {
      crivo[j] = true;
    }
  }
  return primos;
}
struct Link {
  long long from, to, cost;
};
struct Node {
  bool visitado = false;
  set<long long> out;
};
long long a[200][200];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k;
  cin >> n >> m >> k;
  deque<long long> p(k);
  for (auto &x : p) cin >> x;
  long long total = 0;
  for (long long i = 0; i < (long long)n; i++) {
    for (long long j = 0; j < (long long)m; j++) {
      long long x;
      cin >> x;
      for (long long l = 0; l < (long long)k; l++) {
        if (p[l] == x) {
          total += l + 1;
          p.erase(p.begin() + l);
          p.push_front(x);
          break;
        }
      }
    }
  }
  printf("%lld\n", total);
}
