#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 7;
const int maxn = 1007;
int m, n, k, p[maxn], Imp[maxn], res, id, cur;
bool a[maxn][maxn], avail[maxn];
vector<int> adj[maxn];
inline void read(int &x) {
  register int c = getchar();
  x = 0;
  int neg = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
inline void writeln(long long x) {
  char buffor[21];
  register int i = 0;
  int neg = 0;
  if (x < 0) {
    neg = 1;
    x = -x;
  }
  do {
    buffor[i++] = (x % 10) + '0';
    x /= 10;
  } while (x);
  i--;
  if (neg) putchar('-');
  while (i >= 0) putchar(buffor[i--]);
  putchar('\n');
}
void nhap() {
  read(n);
  read(m);
  read(k);
  for (int i = (1), _b = (k); i <= _b; ++i) read(Imp[i]);
  int u, v;
  for (int i = (1), _b = (m); i <= _b; ++i) {
    read(u);
    read(v);
    a[u][v] = a[v][u] = true;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
}
int dfs(int root, int u) {
  avail[u] = false;
  int res = 1;
  if (adj[u].size())
    for (int i = (0), _b = (adj[u].size() - 1); i <= _b; ++i) {
      int v = adj[u][i];
      if (avail[v]) {
        res += dfs(root, v);
        p[v] = root;
      }
    }
  return res;
}
void solve() {
  memset(avail, true, sizeof(avail));
  for (int i = (1), _b = (k); i <= _b; ++i) {
    p[Imp[i]] = Imp[i];
    int temp = dfs(Imp[i], Imp[i]);
    if (temp > cur) {
      cur = temp;
      id = Imp[i];
    }
  }
  for (int i = (1), _b = (n); i <= _b; ++i)
    for (int j = (i + 1), _b = (n); j <= _b; ++j)
      if (p[i] == 0 && p[j] == 0 && !a[i][j]) {
        a[i][j] = a[j][i] = true;
        res++;
      }
  for (int i = (1), _b = (n); i <= _b; ++i)
    if (p[i] > 0) {
      for (int j = (1), _b = (n); j <= _b; ++j)
        if (i != j && p[i] == p[j] && !a[i][j]) {
          res++;
          a[i][j] = a[j][i] = true;
        }
    } else if (p[i] == 0) {
      cur++;
      for (int j = (1), _b = (n); j <= _b; ++j)
        if (p[j] == id && !a[i][j]) {
          a[i][j] = a[j][i] = true;
          res++;
        }
      p[i] = id;
    }
}
void print() { cout << res; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  nhap();
  solve();
  print();
}
