#include <bits/stdc++.h>
using namespace std;
void init_father(int *father, int *hat, int *number, int n) {
  int i;
  memset(hat, 0, sizeof(hat));
  for (i = 1; i <= n; i++) {
    father[i] = i;
    number[i] = 1;
  }
}
int find(int x, int *father) {
  return father[x] == x ? x : father[x] = find(father[x], father);
}
int main() {
  int n, m, k;
  int x, y;
  int maxx, num;
  int c;
  int i;
  int father[1005];
  int hat[1005];
  int number[1005];
  long long int ans;
  init_father(father, hat, number, 1004);
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= k; i++) {
    scanf("%d", &c);
    hat[c]++;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    x = find(x, father);
    y = find(y, father);
    if (x == y) {
    } else if (hat[x]) {
      father[y] = x;
      number[x] += number[y];
      number[y] = 0;
    } else {
      father[x] = y;
      number[y] += number[x];
      number[x] = 0;
    }
  }
  ans = 0;
  maxx = -1;
  num = 0;
  for (i = 1; i <= n; i++) {
    if (father[i] == i) {
      if (hat[i]) {
        ans += number[i] * (number[i] - 1) / 2;
        maxx = max(maxx, number[i]);
      } else {
        num += number[i];
      }
    }
  }
  ans -= m;
  ans -= maxx * (maxx - 1) / 2;
  ans += (maxx + num) * (maxx + num - 1) / 2;
  printf("%I64d\n", ans);
  return 0;
}
