#include <bits/stdc++.h>
using namespace std;
vector<int> adjl[1000];
vector<int> list_size;
bool gov[1000];
bool seen[1000];
int n, size;
bool state;
void traverse(int index) {
  int i;
  size++;
  if (gov[index]) {
    state = 1;
  }
  for (i = 0; i < adjl[index].size(); i++) {
    if (!seen[adjl[index][i]]) {
      seen[adjl[index][i]] = 1;
      traverse(adjl[index][i]);
    }
  }
}
int main() {
  int m, k, i, u, v, nongovsize = 0, all = 0;
  cin >> n >> m >> k;
  for (i = 0; i < k; i++) {
    cin >> v;
    gov[--v] = 1;
  }
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    u--;
    v--;
    adjl[u].push_back(v);
    adjl[v].push_back(u);
  }
  for (i = 0; i < n; i++) {
    if (!seen[i]) {
      seen[i] = 1;
      state = 0;
      size = 0;
      traverse(i);
      if (state) {
        list_size.push_back(size);
      } else {
        nongovsize += size;
      }
    }
  }
  int max = 0;
  for (i = 0; i < list_size.size(); i++) {
    if (list_size[i] > max) {
      max = list_size[i];
    }
  }
  for (i = 0; i < list_size.size(); i++) {
    all += list_size[i] * (list_size[i] - 1) / 2;
  }
  all -= max * (max - 1) / 2;
  all += (max + nongovsize) * (max + nongovsize - 1) / 2;
  cout << all - m;
  return 0;
}
