#include <bits/stdc++.h>
using namespace std;
int n, m, k, a[1111][1111], b[111111], u[1111], c = 0, ok = -1, d = 0, tot = 0;
void dfs(int x) {
  if (b[x]) ok = x;
  u[x] = 1;
  c++;
  for (int i = 0; i < n; i++) {
    if (a[x][i]) d++;
    if (i != x && a[x][i] && !u[i]) dfs(i);
  }
}
int main() {
  cin >> n >> m >> k;
  vector<int> v1, v2;
  for (int i = 0; i < k; i++) {
    int x;
    scanf("%d", &x);
    x--;
    b[x] = 1;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    a[x][y] = 1;
    a[y][x] = 1;
  }
  for (int i = 0; i < n; i++)
    if (!u[i]) {
      c = 0;
      d = 0;
      ok = -1;
      dfs(i);
      int tmp = (c * (c - 1)) / 2;
      d /= 2;
      tot += tmp - d;
      if (ok != -1)
        v1.push_back(c);
      else
        v2.push_back(c);
    }
  sort(v1.begin(), v1.end());
  reverse(v1.begin(), v1.end());
  int ln = 0, gr = 0;
  for (int i = 0; i < v2.size(); i++) {
    ln += gr * v2[i];
    gr += v2[i];
  }
  if (v2.size()) tot += gr * v1[0] + ln;
  cout << tot;
  return 0;
}
