#include <bits/stdc++.h>
using namespace std;
int cnt1, cnt2, a[200005], d[200005], used[20005];
vector<int> v[200005];
void dfs(int x) {
  used[x] = 1;
  cnt2 += d[x];
  cnt1++;
  for (int i = 0; i < v[x].size(); i++) {
    if (used[v[x][i]]) continue;
    dfs(v[x][i]);
  }
}
int main() {
  int n, m, k, x, y, ans = 0, mx = 0;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < k; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
    d[x]++;
    d[y]++;
  }
  for (int i = 0; i < k; i++) {
    cnt1 = 0, cnt2 = 0;
    dfs(a[i]);
    cnt2 /= 2;
    mx = max(mx, cnt1);
    int temp = (cnt1 * (cnt1 - 1)) / 2;
    temp -= cnt2;
    ans += temp;
  }
  for (int i = 1; i <= n; i++) {
    if (used[i] == 0) {
      cnt1 = 0, cnt2 = 0;
      dfs(i);
      cnt2 /= 2;
      int temp = (cnt1 * (cnt1 - 1)) / 2;
      temp -= cnt2;
      ans += temp;
      ans += mx * cnt1;
      mx += cnt1;
    }
  }
  printf("%d\n", ans);
}
