#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > edges;
vector<int> graphs[100001];
bool vis[100001];
int dfs(int s) {
  if (vis[s] == 1) return 0;
  int ans = 0;
  vis[s] = 1;
  for (int i = 0; i < graphs[s].size(); i++) {
    ans += dfs(graphs[s][i]);
  }
  return ans + 1;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int arr[k];
  for (int i = 0; i < k; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graphs[a].push_back(b);
    graphs[b].push_back(a);
  }
  long long sum = 0;
  int go[k];
  for (int i = 0; i < k; i++) {
    int w = dfs(arr[i]);
    go[i] = w;
    sum += w;
  }
  sort(go, go + k);
  go[k - 1] += (n - sum);
  long long ans = 0;
  for (int i = 0; i < k; i++) {
    ans += (go[i] * (go[i] - 1)) / 2;
  }
  ans = ans - m;
  cout << ans << endl;
}
