#include <bits/stdc++.h>
using namespace std;
int main() {
  deque<int> que;
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < k; i++) {
    int tmp;
    scanf("%d", &tmp);
    que.push_back(tmp);
  }
  int ans = 0;
  int val;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      scanf("%d", &val);
      deque<int>::iterator it;
      for (it = que.begin(); it != que.end(); it++) {
        ans++;
        if (*it == val) {
          que.erase(it);
          que.push_front(val);
          break;
        }
      }
    }
  printf("%d\n", ans);
  return 0;
}
