#include <bits/stdc++.h>
using namespace std;
int _I() {
  int x;
  scanf("%d", &x);
  return x;
}
long long _L() {
  long long x;
  scanf("%lld", &x);
  return x;
}
long long gcd(long long x, long long y) {
  if (x % y == 0)
    return y;
  else
    return gcd(y, x % y);
}
long long lcm(long long x, long long y) {
  x /= gcd(x, y);
  return x * y;
}
int kdx[8] = {-2, -2, -1, -1, 1, 1, 2, 2};
int kdy[8] = {-1, 1, -2, 2, -2, 2, -1, 1};
bool prime[100 + 2];
map<int, vector<int> > v;
struct zz {
  int nodes, edges;
} s[1002];
bool vis[1002];
bool vis1[1002];
int nodes, edges;
void dfs(int u) {
  if (vis[u]) {
    return;
  }
  vis[u] = 1;
  int sizev = v[u].size();
  edges += sizev;
  nodes++;
  for (int i = 0; i < v[u].size(); i++) {
    dfs(v[u][i]);
  }
  return;
}
int main() {
  int i, j, n = _I(), m = _I(), k = _I();
  int ar[1002];
  for (i = 0; i < k; i++) {
    ar[i] = _I();
    vis1[ar[i]] = 1;
  }
  for (i = 0; i < m; i++) {
    int x = _I(), y = _I();
    v[x].push_back(y);
    v[y].push_back(x);
    vis1[x] = 1;
    vis1[y] = 1;
  }
  int mx = 0, c = 0;
  for (i = 0; i < k; i++) {
    nodes = 0;
    edges = 0;
    dfs(ar[i]);
    s[i].nodes = nodes;
    s[i].edges = edges;
  }
  int extra_edges = 0;
  for (i = 1; i <= n; i++) {
    if (!vis[i]) c++;
  }
  for (i = 1; i <= n; i++) {
    if (vis[i] != vis1[i]) {
      edges = 0;
      dfs(i);
      edges /= 2;
      extra_edges += edges;
    }
  }
  int idx = 0;
  for (i = 0; i < k; i++) {
    int temp, temp1;
    temp = s[i].nodes + c;
    temp1 = (temp * (temp - 1)) / 2;
    s[i].edges /= 2;
    if (mx < (temp1 - (s[i].edges + extra_edges))) {
      mx = temp1 - (s[i].edges + extra_edges);
      idx = i;
    }
  }
  for (i = 0; i < k; i++) {
    if (i == idx) continue;
    int temp1 = s[i].nodes;
    temp1 = (temp1 * (temp1 - 1)) / 2;
    mx += (temp1 - s[i].edges);
  }
  printf("%d", mx);
  return 0;
}
