#include <bits/stdc++.h>
using namespace std;
vector<int> graph[10001];
int arr[10001], visited[10001], node, edge;
long long ans;
void DFS(int u, int par) {
  visited[u] = 1;
  node++;
  for (int i = 0; i < graph[u].size(); i++) {
    int x = graph[u][i];
    if (x == par) continue;
    edge++;
    if (visited[x] == 0) {
      DFS(x, u);
    }
  }
  return;
}
int main() {
  int i, j, n, m, t, p, u, v, maxnode, cas = 1;
  while (scanf("%d %d %d", &n, &m, &p) == 3) {
    ans = maxnode = 0;
    memset(arr, 0, sizeof arr);
    memset(visited, 0, sizeof visited);
    for (i = 0; i < p; i++) {
      scanf("%d", &arr[i]);
    }
    for (i = 0; i < m; i++) {
      scanf("%d %d", &u, &v);
      graph[u].push_back(v);
      graph[v].push_back(u);
    }
    for (i = 0; i < p; i++) {
      node = 0;
      edge = 0;
      DFS(arr[i], -1);
      ans = ans + (node * (node - 1)) / 2;
      maxnode = max(maxnode, node);
    }
    for (i = 1; i <= n; i++) {
      if (visited[i] == 0) {
        ans += maxnode;
        maxnode++;
      }
    }
    printf("%I64d\n", ans - m);
    for (i = 0; i <= n; i++) graph[i].clear();
  }
  return 0;
}
