#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, m, k, p, art, aux, cuenta = 0;
  cin >> n >> m >> k;
  int pos[k];
  for (int i = 0; i < k; i++) {
    cin >> p;
    pos[p - 1] = i + 1;
  }
  for (int i = 0; i < m * n; i++) {
    cin >> art;
    aux = pos[art - 1];
    cuenta = cuenta + aux;
    for (int j = 0; j < k; j++) {
      if (pos[j] < aux) {
        pos[j]++;
      }
    }
    pos[art - 1] = 1;
  }
  cout << cuenta;
}
