#include <bits/stdc++.h>
using namespace std;
vector<int> g[10001];
int visited[10001];
int v = 0;
void dfs(int node) {
  if (visited[node]) return;
  visited[node] = 1;
  v++;
  for (int i = 0; i < g[node].size(); i++) dfs(g[node][i]);
}
int main() {
  vector<int> special_nodes;
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    special_nodes.push_back(x);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  int mv = 0, tv = 0;
  int ans = 0;
  for (int i = 0; i < k; i++) {
    v = 0;
    dfs(special_nodes[i]);
    tv += v;
    ans += v * (v - 1) / 2;
    mv = max(mv, v);
  }
  n = mv + (n - tv);
  cout << ans - mv * (mv - 1) / 2 + n * (n - 1) / 2 - m;
}
