#include <bits/stdc++.h>
using namespace std;
int n, m, k, cuenta = 0;
vector<int> gov, vis, res;
vector<vector<int>> graph;
void dfs(int x) {
  vis[x] = 1;
  cuenta++;
  for (int y : graph[x]) {
    if (!vis[y]) {
      dfs(y);
    }
  }
}
int main() {
  cin >> n >> m >> k;
  gov.resize(k);
  vis.resize(n + 1), res.resize(k), graph.resize(n + 1);
  for (int i = 0; i < k; i++) {
    cin >> gov[i];
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graph[a].emplace_back(b);
    graph[b].emplace_back(a);
  }
  for (int i = 0; i < k; i++) {
    cuenta = 0;
    dfs(gov[i]);
    res[i] = cuenta;
  }
  sort(res.begin(), res.end(), greater<int>());
  int sum = n - accumulate(res.begin(), res.end(), 0);
  res[0] += sum;
  int ans = 0;
  for (int x : res) {
    ans += (x * (x - 1)) / 2;
  }
  cout << ans - m << "\n";
  return 0;
}
