#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
long long ans = 0ll, deg = 0, cnt = 0;
int n, m, k, imp = 0;
bool vis[N], vip[N];
vector<int> adj[N];
vector<pair<long long, long long> > gov, Not;
void dfs(int u) {
  vis[u] = 1;
  cnt++;
  deg += adj[u].size();
  if (vip[u]) imp = 1;
  for (auto v : adj[u])
    if (!vis[v]) dfs(v);
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  int x;
  for (int i = 0; i < k; i++) {
    scanf("%d", &x);
    vip[x] = 1;
  }
  int u, v;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      cnt = 0;
      imp = 0;
      deg = 0;
      dfs(i);
      if (imp)
        gov.push_back({cnt, deg / 2});
      else
        Not.push_back({cnt, deg / 2});
    }
  long long mx = 0;
  for (auto G : gov) {
    long long V = G.first;
    long long E = G.second;
    ans += V * (V - 1ll) / 2ll - E;
    mx = max(mx, V);
  }
  long long sum = 0, sum2 = 0;
  for (auto N : Not) {
    sum += N.first;
    sum2 += N.second;
  }
  ans += sum * (sum - 1ll) / 2ll - sum2;
  ans += sum * mx;
  printf("%lld\n", ans);
}
