#include <bits/stdc++.h>
using namespace std;
long long king[1005];
bool vis[1005];
bool vise[1005][1005];
long long x, y;
vector<long long> g[1005];
void dfs(long long src) {
  vis[src] = 1;
  x++;
  for (long long i = 0; i < g[src].size(); i++) {
    if (!vis[g[src][i]]) {
      dfs(g[src][i]);
    }
  }
}
void dfse(long long src) {
  for (long long i = 0; i < g[src].size(); i++) {
    if (vise[src][g[src][i]] == 0 || vise[g[src][i]][src] == 0) {
      vise[src][g[src][i]] = true;
      vise[g[src][i]][src] = true;
      y++;
      dfse(g[src][i]);
    }
  }
}
int main() {
  long long n, m, k, u, v;
  cin >> n >> m >> k;
  for (long long i = 1; i <= k; i++) {
    cin >> king[i];
  }
  for (long long i = 1; i <= m; i++) {
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long cntv = 0;
  long long cnte = 0;
  long long more_edge = 0;
  for (long long i = 1; i <= k; i++) {
    x = 0;
    y = 0;
    dfs(king[i]);
    dfse(king[i]);
    more_edge = more_edge + ((x * (x - 1)) / 2 - y);
    cntv = max(cntv, x);
    cnte = max(cnte, y);
  }
  more_edge = more_edge - ((cntv * (cntv - 1)) / 2 - cnte);
  for (long long i = 1; i <= n; i++) {
    if (!vis[i]) {
      x = 0;
      y = 0;
      dfs(i);
      dfse(i);
      cntv = cntv + x;
      cnte = cnte + y;
    }
  }
  long long res = (((cntv * (cntv - 1)) / 2) - cnte) + more_edge;
  cout << res;
  return 0;
}
