#include <bits/stdc++.h>
using namespace std;
vector<int> v, v1;
void mover(int x, int n) {
  v1.erase(v1.begin(), v1.end());
  int temp1 = v[x];
  v.erase(v.begin() + x);
  v1.push_back(temp1);
  for (int i = 0; i < v.size(); i++) v1.push_back(v[i]);
  v.erase(v.begin(), v.end());
  for (int i = 0; i < v1.size(); i++) v.push_back(v1[i]);
}
int pos(int n) {
  for (int i = 0; i < v.size(); i++) {
    if (v[i] == n) return i;
  }
}
int main() {
  int n, m, k, h, s, temp, ans = 0;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> h;
    v.push_back(h);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> s;
      temp = pos(s);
      mover(temp, n);
      ans += temp + 1;
    }
  }
  cout << ans;
}
