#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int cnt = 0;
int visited[1001] = {0};
vector<int> adj[1001];
void dfs(int node) {
  visited[node] = 1;
  for (int next : adj[node]) {
    if (!visited[next]) {
      dfs(next);
      cnt++;
    }
  }
}
int main() {
  fast();
  int n, m, k;
  cin >> n >> m >> k;
  int c[k];
  for (int i = 0; i < k; i++) {
    cin >> c[i];
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  vector<int> lengths;
  int left_nodes = n;
  for (int i = 0; i < k; i++) {
    cnt = 1;
    dfs(--c[i]);
    lengths.push_back(cnt);
    left_nodes -= cnt;
  }
  sort(lengths.rbegin(), lengths.rend());
  lengths[0] += left_nodes;
  int ans = 0;
  ans -= m;
  for (int i = 0; i < lengths.size(); i++) {
    int d = lengths[i];
    ans += (((d) * (d - 1)) / 2);
  }
  cout << ans << "\n";
}
