#include <bits/stdc++.h>
using namespace std;
inline bool ascending(int i, int j) { return (i < j); }
inline bool descending(int i, int j) { return (i > j); }
const int MN = 1000 + 51;
int arr[1001];
int res;
int n, k, m;
void update(int t) {
  int temp = t;
  for (int i = 1; i <= m; ++i) {
    swap(arr[i], temp);
    if (t == temp) {
      res += i;
      break;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> m;
  for (int i = 0; i < m; ++i) {
    int temp;
    cin >> temp;
    arr[i + 1] = temp;
  }
  for (__typeof(0) i = 0; i != n; i++)
    for (__typeof(0) j = 0; j != k; j++) {
      int t;
      cin >> t;
      update(t);
    }
  cout << res << endl;
  return 0;
}
