#include <bits/stdc++.h>
using namespace std;
int a[103], n, x, y, m, ans;
int main() {
  cin >> x >> y >> n;
  m = x * y;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) {
    int x, j;
    cin >> x;
    for (j = 0; j < n; j++) {
      if (a[j] == x) break;
    }
    ans = ans + j + 1;
    for (int k = j - 1; k >= 0; k--) a[k + 1] = a[k];
    a[0] = x;
  }
  cout << ans;
}
