#include <bits/stdc++.h>
using namespace std;
const long long dx[4] = {-1, 0, 0, 1};
const long long dy[4] = {0, -1, 1, 0};
void faster() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
long long a, b, n, m, z, k, ans, x, ar[10001][123];
string s, t, g, tt, gg;
vector<long long> aa, bb, vv;
bool ok, yes;
void dii() {
  faster();
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> ar[0][i];
  }
  for (int i = 1; i <= n * m; i++) {
    cin >> x;
    for (int j = 0; j < k; j++) {
      if (ar[i - 1][j] == x) {
        ans += j + 1;
        z = j;
        break;
      }
    }
    ar[i][0] = x;
    for (int u = 0; u < z; u++) {
      ar[i][u + 1] = ar[i - 1][u];
    }
    for (int u = z + 1; u < k; u++) {
      ar[i][u] = ar[i - 1][u];
    }
  }
  cout << ans;
}
int main() {
  faster();
  int q = 1;
  while (q--) {
    dii();
  }
  return 0;
}
