#include <bits/stdc++.h>
using namespace std;
vector<int> vec[100100];
int arr[100100];
long long sum = 0, sum1 = 0, sumn = 0, ans = 0, maxi = 0;
bool visit[100100];
void dfs(int node) {
  visit[node]++;
  sum++;
  sum1 += (long long)vec[node].size();
  for (int i = 0; i < vec[node].size(); i++) {
    int x = vec[node][i];
    if (!visit[x]) dfs(x);
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) scanf("%d", &arr[i]);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    vec[x].push_back(y);
    vec[y].push_back(x);
  }
  for (int i = 0; i < k; i++) {
    sum = 0, sum1 = 0;
    dfs(arr[i]);
    ans += ((sum - 1) * sum - sum1) / 2;
    sumn += sum;
    maxi = max(maxi, sum);
  }
  sum1 = 0;
  for (int i = 1; i <= n; i++)
    if (!visit[i]) {
      dfs(i);
    }
  sumn = n - sumn;
  ans += (sumn)*maxi;
  ans += ((sumn - 1) * sumn - sum1) / 2;
  cout << ans << endl;
  return 0;
}
