#include <bits/stdc++.h>
using namespace std;
const int N = (int)3e5 + 7;
const int inf = (int)1e9 + 7;
int n, m, k;
int sz[N], pr[N], c = 1, rang[N], sz1[N], was[N];
vector<int> gr[N];
int getpar(int a) {
  if (a == pr[a]) return a;
  return pr[a] = getpar(pr[a]);
}
void connect(int a, int b) {
  a = getpar(a);
  b = getpar(b);
  if (a != b) {
    if (rang[a] > rang[b]) {
      pr[b] = a;
      sz[a] += sz[b];
    } else {
      pr[a] = b;
      sz[b] += sz[a];
    }
  }
}
long long get(long long r) { return r * (r - 1) / 2; }
int main() {
  scanf("%d %d %d", &n, &m, &k);
  iota(pr + 1, pr + n + 1, 1);
  fill(sz + 1, sz + n + 1, 1);
  fill(rang + 1, rang + n + 1, 1);
  rang[0] = inf + 1;
  for (int i = 1; i <= k; i++) {
    int x;
    scanf("%d", &x);
    rang[x] = inf;
  }
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    connect(u, v);
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
  int siz = -1;
  int big = 0;
  for (int i = 1; i <= n; i++) {
    int b = getpar(i);
    if (rang[b] != inf) {
      connect(big, b);
    }
  }
  for (int i = 1; i <= n; i++) {
    int a = getpar(i);
    sz1[a] += (int)gr[i].size();
  }
  for (int i = 0; i <= n; i++) {
    sz1[i] /= 2;
  }
  long long ans = 0;
  int in = 0;
  for (int i = 1; i <= n; i++) {
    int a = getpar(i);
    if (a) {
      if (get(sz[0] + sz[a]) - sz1[0] - sz1[a] > ans) {
        ans = get(sz[0] + sz[a]) - sz1[0] - sz1[a];
        in = a;
      }
    }
  }
  connect(in, 0);
  for (int i = 1; i <= n; i++) {
    int a = getpar(i);
    if (a != 0) {
      if (was[a]) continue;
      ans += get(sz[a]) - sz1[a];
      was[a] = 1;
    }
  }
  cout << ans;
}
