#include <bits/stdc++.h>
using namespace std;
const int o = 1000000009;
int main() {
  int n, m, k, x, time = 0, pos;
  cin >> n >> m >> k;
  int list[1000];
  for (int i = 0; i < k; i++) {
    cin >> list[i];
  }
  for (int i = 0; i < n; i++) {
    for (int z = 0; z < m; z++) {
      cin >> x;
      for (int j = 0; j < k; j++) {
        if (list[j] == x) {
          time += j + 1;
          pos = list[j];
          for (int k = j; k > 0; k--) {
            list[k] = list[k - 1];
          }
          list[0] = pos;
          break;
        }
      }
    }
  }
  cout << time;
  cin >> n;
  return 0;
}
