#include <bits/stdc++.h>
using namespace std;
const int lim = 1e5 + 7;
int n, m, k, x, y;
vector<int> adj[lim];
vector<int> goverm;
bool visited[lim];
int label[lim];
int cnt = 0;
int edges = 0;
void DFS(int idx) {
  visited[idx] = true;
  cnt++;
  for (int i = 0; i < adj[idx].size(); i++) {
    int nxt = adj[idx][i];
    if (!visited[nxt]) {
      label[nxt] = label[idx];
      DFS(nxt);
    }
    edges++;
  }
}
void solve() {
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    cin >> x;
    goverm.push_back(x);
    label[x] = x;
  }
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  int answToAdd = 0;
  int mxSize = 0;
  int mxGov = -1;
  for (int i = 0; i < goverm.size(); i++) {
    cnt = edges = 0;
    DFS(goverm[i]);
    edges /= 2;
    if (cnt > mxSize) {
      mxSize = cnt;
      mxGov = goverm[i];
    }
    int toAdd = ((cnt * (cnt - 1)) / 2) - edges;
    answToAdd += toAdd;
  }
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      cnt = edges = 0;
      DFS(i);
      edges /= 2;
      int toAdd = ((cnt * (cnt - 1)) / 2) - edges;
      answToAdd += toAdd;
      toAdd = cnt * mxSize;
      mxSize += cnt;
      answToAdd += toAdd;
    }
  }
  cout << answToAdd;
}
int main() {
  if (fopen("d:\\lmo.in", "r") != NULL) {
    freopen("d:\\lmo.in", "r", stdin);
  } else if (fopen("/media/luismo/Pablo's Destruction/lmo.in", "r") != NULL) {
    freopen("/media/luismo/Pablo's Destruction/lmo.in", "r", stdin);
  }
  cin.sync_with_stdio(false);
  cin.tie(0);
  solve();
}
