#include <bits/stdc++.h>
using namespace std;
struct code {
  int x, y;
};
int comp(code a, code b) { return a.x < b.x or (a.x == b.x and a.y < b.y); }
int cnt;
bool used[10000];
int a[10000];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    cin >> a[i];
  }
  int x;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> x;
      used[x] = 0;
      int ind;
      for (int j = 1; j <= k; j++) {
        if (a[j] == x) {
          ind = j;
          break;
        }
      }
      cnt += ind;
      for (int j = ind - 1; j >= 1; j--) {
        swap(a[ind], a[j]);
        ind = j;
      }
    }
  }
  cout << cnt;
}
