#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 1;
int n, m, k, in, a, b, ver, edg, ans, mx, all;
vector<int> cap, arr[MAX];
bool vis[MAX];
void dfs(int v) {
  ++ver;
  edg += arr[v].size();
  vis[v] = true;
  for (auto it : arr[v])
    if (!vis[it]) dfs(it);
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 0; i < k; ++i) cin >> in, cap.push_back(in);
  for (int i = 0; i < m; ++i)
    cin >> a >> b, arr[a].push_back(b), arr[b].push_back(a);
  for (auto it : cap) {
    ver = 0, edg = 0;
    dfs(it);
    ans += ver * (ver - 1) / 2;
    if (ver > mx) mx = ver;
  }
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) ans += mx, ++mx;
  cout << ans - m;
  return 0;
}
