#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
vector<int> G[N];
int n, m, k, mark[N], g;
bool vis[N], c[N], a[N][N];
vector<int> gp[N];
void bfs(int s) {
  queue<int> q;
  while (!q.empty()) q.pop();
  vis[s] = 1;
  gp[g].clear();
  q.push(s);
  while (!q.empty()) {
    int x = q.front();
    q.pop();
    if (c[x] == 1) {
      mark[g] = 1;
    }
    gp[g].push_back(x);
    int len = G[x].size();
    for (int i = 0; i < len; i++) {
      int y = G[x][i];
      if (!vis[y]) {
        q.push(y);
        vis[y] = 1;
      }
    }
  }
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i <= n; i++) {
    G[i].clear();
  }
  memset(c, 0, sizeof(c));
  int tmp;
  for (int i = 0; i < k; i++) {
    scanf("%d", &tmp);
    c[tmp] = 1;
  }
  int u, v, mm = m;
  memset(a, 0, sizeof(a));
  while (m--) {
    scanf("%d%d", &u, &v);
    a[u][v] = a[v][u] = 1;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  memset(vis, 0, sizeof(vis));
  memset(mark, 0, sizeof(mark));
  g = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      bfs(i);
      g++;
    }
  }
  int ump = 0, ans = 0, Max = 0;
  for (int i = 0; i < g; i++) {
    if (!mark[i]) {
      int len = gp[i].size();
      for (int j = 0; j < len; j++) {
        for (int k = j + 1; k < len; k++) {
          int u = gp[i][j], v = gp[i][k];
          if (a[u][v]) ans--;
        }
      }
      ump += len;
    } else {
      int len = gp[i].size();
      Max = max(Max, len);
      for (int j = 0; j < len; j++) {
        for (int k = j + 1; k < len; k++) {
          int u = gp[i][j], v = gp[i][k];
          if (!a[u][v]) ans++;
        }
      }
    }
  }
  ans += ump * (ump - 1) / 2;
  ans += ump * Max;
  printf("%d\n", ans);
  return 0;
}
