#include <bits/stdc++.h>
using namespace std;
const int MX = 100001;
long long md = 1e9 + 7;
long long N, M, k;
bool vis[MX];
vector<vector<long long> > G(MX);
long long gov[MX];
vector<long long> com;
long long dfs(long long x) {
  long long res = 1;
  vis[x] = 1;
  for (int i = 0; i < G[x].size(); i++)
    if (!vis[G[x][i]]) res += dfs(G[x][i]);
  return res;
}
int main() {
  cin >> N >> M >> k;
  for (int i = 0; i < k; i++) cin >> gov[i];
  for (int i = 0; i < M; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for (int i = 0; i < k; i++) {
    com.push_back(dfs(gov[i]));
  }
  sort(com.begin(), com.end());
  long long rest = 0;
  for (int i = 1; i <= N; i++) {
    if (!vis[i]) rest++;
  }
  rest += com[com.size() - 1];
  com.pop_back();
  long long ans = 0;
  for (int i = 0; i < com.size(); i++) {
    ans += (com[i] * (com[i] - 1)) / 2;
  }
  cout << ans + (rest * (rest - 1)) / 2 - M << "\n";
  return 0;
}
