#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e3 + 5;
const int mod = (int)1e9 + 7;
int n, m, k, c[N], cr, rb, nn, mx, u[N], rb2;
vector<int> g[N];
long long ans;
void dfs(int v) {
  u[v] = 1;
  cr++;
  rb += g[v].size();
  for (auto to : g[v]) {
    if (u[to] == 0) {
      dfs(to);
    }
  }
}
void dfs2(int v) {
  u[v] = 1;
  rb2 += g[v].size();
  for (auto to : g[v]) {
    if (u[to] == 0) {
      dfs2(to);
    }
  }
}
inline void solve() {
  scanf("%d%d%d", &n, &m, &k);
  nn = n;
  for (int i = 1; i <= k; i++) {
    scanf("%d", &c[i]);
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    g[x].emplace_back(y);
    g[y].emplace_back(x);
  }
  for (int i = 1; i <= k; i++) {
    cr = 0;
    rb = 0;
    dfs(c[i]);
    nn -= cr;
    mx = max(mx, cr);
    ans += (cr * 1LL * (cr - 1) - rb) >> 1;
  }
  for (int i = 1; i <= n; i++) {
    if (u[i] == 0) {
      dfs2(i);
    }
  }
  if (nn > 0) {
    ans += mx * 1LL * nn + (nn * 1LL * (nn - 1) >> 1) - rb2 / 2;
  }
  printf("%I64d\n", max(0LL, ans));
}
int tests = 1;
int main() {
  while (tests--) {
    solve();
  }
  return 0;
}
