#include <bits/stdc++.h>
using namespace std;
int a[105];
int main() {
  int i, j, m1, m2, p, q, x1, x2, y1, y2, l, r, n, k, x, y, hh, mm, m;
  long long sum, n1, n2, num, ans, h1, h2;
  bool flag;
  while (cin >> n >> m >> k) {
    for (i = 1; i <= k; i++) cin >> a[i];
    sum = 0;
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        cin >> x;
        for (y = 1; y <= k; y++)
          if (a[y] == x) break;
        p = a[y];
        sum += y;
        for (q = y; q > 1; q--) a[q] = a[q - 1];
        a[1] = p;
      }
    }
    cout << sum << endl;
  }
  return 0;
}
