#include <bits/stdc++.h>
using namespace std;
bool o[1000000 + 100];
vector<int> v[1000000 + 100];
int p, p1, sum, n, m, k, g[1000000 + 100], b[1000000 + 100], maxx = -10, br;
pair<int, int> a[1000000 + 100];
void dfs(int n) {
  p++;
  o[n] = true;
  for (int i = 0; i < v[n].size(); i++) {
    int y = v[n][i];
    p1++;
    if (o[y] == true) continue;
    dfs(y);
  }
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= k; i++) {
    scanf("%d", &g[i]);
    b[g[i]]++;
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  br = n;
  for (int i = 1; i <= k; i++) {
    dfs(g[i]);
    sum += p * (p - 1) / 2 - p1 / 2;
    maxx = max(maxx, p);
    m -= p1 / 2;
    br -= p;
    p1 = 0;
    p = 0;
  }
  sum += br * maxx - m + br * (br - 1) / 2;
  printf("%d", sum);
  return 0;
}
