#include <bits/stdc++.h>
using namespace std;
int fid[1000];
bool cap[1000];
int sz[1000];
int find(int i) {
  if (fid[i] == i) return i;
  return fid[i] = find(fid[i]);
}
void join(int i, int j) {
  i = find(i), j = find(j);
  if (i == j) return;
  fid[i] = j;
  sz[j] += sz[i];
  cap[j] = (cap[j] || cap[i]);
}
int main() {
  int N, M, K;
  cin >> N >> M >> K;
  for (int i = 0; i < N; i++) fid[i] = i, sz[i] = 1;
  int c;
  for (int i = 0; i < K; i++) {
    cin >> c;
    cap[c - 1] = 1;
  }
  int a, b;
  for (int i = 0; i < M; i++) {
    cin >> a >> b;
    join(a - 1, b - 1);
  }
  long long outer = 0;
  for (int i = 0; i < N; i++)
    if (find(i) == i && !cap[i]) outer += sz[i];
  int mxi = find(c - 1);
  for (int i = 0; i < N; i++)
    if (find(i) == i && cap[i] && sz[i] > sz[mxi]) mxi = i;
  outer += sz[mxi];
  long long ans = outer * (outer - 1);
  for (int i = 0; i < N; i++)
    if (find(i) == i && cap[i] && i != mxi)
      ans += ((long long)sz[i]) * ((long long)(sz[i] - 1));
  cout << (ans / 2) - M << '\n';
}
