#include <bits/stdc++.h>
using namespace std;
long long int c;
vector<long long int> cnt(100001, 0);
vector<int> vis(100001, 0);
vector<long long int> adj[100001];
void dfs(long long int src) {
  c++;
  vis[src] = 1;
  for (long long int i = 0; i < adj[src].size(); i++) {
    long long int a = adj[src][i];
    if (!vis[a]) dfs(a);
  }
}
int main() {
  long long int n, m, k, i, u, v, temp;
  cin >> n >> m >> k;
  vector<long long int> arr(k);
  vector<long long int> cnt(n + 1, 0);
  temp = n;
  for (i = 0; i < k; i++) cin >> arr[i];
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  long long int ind, mx = 1;
  for (i = 0; i < k; i++) {
    c = 0;
    dfs(arr[i]);
    cnt[arr[i]] = c;
    temp = temp - c;
    if (c >= mx) {
      mx = c;
      ind = i;
    }
  }
  cnt[arr[ind]] = cnt[arr[ind]] + temp;
  long long int ans = 0;
  for (i = 0; i < k; i++) {
    long long int b = cnt[arr[i]];
    ans = ans + (b * (b - 1)) / 2;
  }
  cout << ans - m << endl;
}
