#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int n, m, k;
int p[N];
int a[N][N];
bool read() {
  if (!(cin >> n >> m >> k)) return false;
  for (int i = 0; i < k; i++) scanf("%d", &p[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      scanf("%d", &a[i][j]);
    }
  }
  return true;
}
void solve() {
  int t, res = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      t = int(find(p, p + k, a[i][j]) - p);
      res += t + 1;
      for (int r = t; r > 0; r--) p[r] = p[r - 1];
      p[0] = a[i][j];
    }
  }
  cout << res << endl;
}
int main() {
  while (read()) {
    solve();
  }
  return 0;
}
