#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 10;
const long long mod = 1e9 + 7;
int n, m, k, len[N], tp[N], pr[N], x, y, st[N], ans, reb[N], mr, us[N],
    deb[1007][1007];
vector<long long> g[N];
int fs(int x) {
  if (x == pr[x]) return x;
  return pr[x] = fs(pr[x]);
}
void uns(int a, int b) {
  a = fs(a);
  b = fs(b);
  if (a == b) return;
  if (len[a] < len[b]) swap(a, b);
  pr[b] = a;
  len[a] += len[b];
}
void dfs(long long x) {
  us[x] = 1;
  for (int i = 0; i < g[x].size(); i++) {
    if (!deb[x][g[x][i]]) mr++, deb[x][g[x][i]] = 1, deb[g[x][i]][x] = 1;
    if (!us[g[x][i]]) {
      dfs(g[x][i]);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) len[i] = 1, pr[i] = i, reb[i] = 0;
  for (int i = 1; i <= k; i++) {
    cin >> x;
    st[x] = 1;
  }
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
    uns(x, y);
  }
  for (int i = 1; i <= n; i++) {
    if (st[i] == 1) {
      tp[fs(i)] = 1;
    }
  }
  long long mx = 0, r = 0;
  for (int i = 1; i <= n; i++) {
    if (!us[i]) {
      dfs(i);
      reb[fs(i)] = mr;
      int t = fs(i);
      ans += ((len[t] * (len[t] - 1)) >> 1) - reb[t];
      mr = 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (tp[fs(i)] == 1) {
      int t = fs(i);
      if (mx < len[fs(i)]) {
        mx = len[fs(i)];
        r = fs(i);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (tp[fs(i)] == 0) {
      ans += mx * len[fs(i)];
      int t = fs(i);
      mx += len[fs(i)];
      tp[fs(i)] = 1;
    }
  }
  cout << ans;
  return 0;
}
