#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  deque<int> que(k);
  for (int i = 0; i < k; ++i) {
    scanf("%d", &que[i]);
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int p = 0; p < m; ++p) {
      int t;
      scanf("%d", &t);
      for (int j = 0; j < k; ++j) {
        if (que[j] == t) {
          ans += (j + 1);
          que.erase(que.begin() + j);
          que.push_front(t);
          break;
        }
      }
    }
  }
  cout << ans;
  return 0;
}
