#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k, i, j, ans = 0, pos[110], temp, t, x, position;
  cin >> n >> m >> k;
  for (i = 1; i <= k; i++) cin >> pos[i];
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      cin >> x;
      for (t = 1; t <= k; t++)
        if (pos[t] == x) {
          position = t;
          ans += t;
          break;
        }
      temp = pos[position];
      for (t = position - 1; t >= 1; t--) pos[t + 1] = pos[t];
      pos[1] = temp;
    }
  }
  cout << ans << endl;
  return 0;
}
