#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int N3 = 1e3 + 10;
const int INF = 2e9 + 10;
const int mod = 1e9 + 7;
const long long LINF = 4e18 + 10;
int n, m, k, looked[N], sz[N], sum, cnt, vertex, mx, pos, edge;
bool u[N], is[N];
vector<int> v[N];
void dfs(int x) {
  u[x] = 1;
  sz[cnt]++;
  for (int i = 0; i < v[x].size(); ++i) {
    int to = v[x][i];
    looked[cnt]++;
    if (!u[to]) {
      dfs(to);
    }
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; ++i) {
    int x;
    cin >> x;
    is[x] = 1;
  }
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) {
    if (is[i]) {
      cnt++;
      dfs(i);
      sum += sz[cnt];
      looked[cnt] /= 2;
    }
  }
  for (int i = 1; i <= cnt; ++i) {
    vertex += sz[i];
    edge += looked[i];
  }
  vertex = n - vertex;
  edge = m - edge;
  int ans = 0;
  for (int i = 1; i <= cnt; ++i) {
    int temp = sz[i] + vertex;
    if (temp * (temp - 1) / 2 - looked[i] - edge > mx) {
      mx = temp * (temp - 1) / 2 - looked[i] - edge;
      pos = i;
    }
    ans += sz[i] * (sz[i] - 1) / 2 - looked[i];
  }
  ans = mx;
  for (int i = 1; i <= cnt; ++i) {
    if (i == pos) {
      continue;
    }
    ans += sz[i] * (sz[i] - 1) / 2 - looked[i];
  }
  cout << ans;
  return 0;
}
