#include <bits/stdc++.h>
using namespace std;
int n, m, k, c[100100];
list<int> adj[100100];
bitset<1000100> visited;
int counter, sum;
void dfs(int u) {
  visited[u] = true;
  counter++;
  for (__typeof((adj[u]).begin()) v = (adj[u]).begin(); v != (adj[u]).end();
       v++)
    if (!visited[*v]) dfs(*v);
}
int main() {
  int u, v;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < int(k); i++) scanf("%d", &c[i + 1]);
  for (int i = 0; i < int(m); i++) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  sum = 0;
  int solution = 0ll, cmp_max = 0;
  for (int i = 0; i < int(k); i++) {
    counter = 0;
    dfs(c[i + 1]);
    solution += (counter * (counter - 1)) / 2;
    cmp_max = max(cmp_max, counter);
    sum += counter;
  }
  solution -= (cmp_max * (cmp_max - 1)) / 2;
  solution += ((cmp_max + n - sum) * (cmp_max + n - sum - 1)) / 2;
  printf("%d\n", solution - m);
}
