#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int g[1007], par[1007];
long long ans = 0;
int find(int x) {
  if (x == par[x])
    return x;
  else
    return par[x] = find(par[x]);
}
struct Gov {
  int x;
  long long num;
  bool operator<(Gov a) const { return num > a.num; }
};
vector<Gov> v;
map<int, int> mym;
map<int, int>::iterator it;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  fill(g, g + n, 0);
  for (int i = 1; i <= n; i++) par[i] = i;
  for (int i = 0; i < k; i++) {
    int x;
    scanf("%d", &x);
    mym[x] = 1;
    g[x] = x;
  }
  for (int i = 0; i < m; i++) {
    int x, y, px, py;
    scanf("%d%d", &x, &y);
    px = find(x), py = find(y);
    if (g[px] && !g[py])
      par[py] = px;
    else if (g[py] && !g[px])
      par[px] = py;
    else if (!g[py] && !g[px])
      par[px] = py;
  }
  for (int i = 1; i <= n; i++) {
    int pi = find(i);
    if (i != pi && g[pi]) mym[pi] += 1;
  }
  for (it = mym.begin(); it != mym.end(); it++) {
    Gov tmp;
    tmp.x = (*it).first;
    tmp.num = (*it).second;
    v.push_back(tmp);
  }
  sort(v.begin(), v.end());
  int tar = v[0].x, num = 0;
  for (int i = 1; i <= n; i++) {
    int pi = find(i);
    if (g[pi] == 0) par[pi] = tar;
  }
  for (int i = 1; i <= n; i++) {
    int pi = find(i);
    if (g[pi] == tar) num++;
  }
  v[0].num = num;
  for (int i = 0; i < k; i++) ans += (v[i].num - 1) * v[i].num / 2;
  ans -= m;
  cout << ans << endl;
}
