#include <bits/stdc++.h>
using namespace std;
int n, m, k, item, ans;
deque<int>::iterator it;
deque<int> d;
int main() {
  cin >> n >> m >> k;
  while (k--) {
    cin >> item;
    d.push_back(item);
  }
  ans = 0;
  for (int i = 0; i < n * m; i++) {
    cin >> item;
    for (it = d.begin(); it != d.end(); it++) {
      ans++;
      if (*it != item) {
        continue;
      }
      d.erase(it);
      break;
    }
    d.push_front(item);
  }
  cout << ans << endl;
  return 0;
}
