#include <bits/stdc++.h>
using namespace std;
int q = 1;
int n, m, k, a[110], mp[110], ans;
void solve() {
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> a[i];
    mp[a[i]] = i;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      int x;
      cin >> x;
      ans += mp[x] + 1;
      for (int l = mp[x]; l > 0; l--) {
        mp[a[l - 1]]++;
        swap(a[l], a[l - 1]);
      }
      mp[x] = 0;
    }
  }
  cout << ans << endl;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  while (q--) {
    solve();
  }
}
