#include <bits/stdc++.h>
using namespace std;
const int MX = (int)1e6 + 17;
const int MOD = (int)1e9 + 7;
const long long oo = (long long)1e18 + 7;
const int INF = (int)999999999;
const int N = (int)1e5 + 17;
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};
inline long long IN() {
  long long x = 0, ch = getchar(), f = 1;
  while (!isdigit(ch) && (ch != '-') && (ch != EOF)) ch = getchar();
  if (ch == '-') {
    f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void OUT(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10)
    OUT(x / 10), putchar(x % 10 + '0');
  else
    putchar(x + '0');
}
int n, m, k, ans;
vector<int> a, b;
int main() {
  cin >> n >> m >> k;
  for (int i = 1, x; i <= k; i++) {
    cin >> x;
    a.push_back(x);
  }
  for (int i = 1, x; i <= n; i++) {
    for (int j = 1, x; j <= m; j++) {
      cin >> x;
      for (int l = 0; l < (int)a.size(); l++) {
        if (a[l] == x)
          ans += l + 1;
        else
          b.push_back(a[l]);
      }
      a.clear();
      a.push_back(x);
      for (int j = 0; j < (int)b.size(); j++) a.push_back(b[j]);
      b.clear();
    }
  }
  cout << ans;
  return 0;
}
