#include <bits/stdc++.h>
using namespace std;
const int maxv = 1005;
int V;
vector<int> G[maxv];
vector<int> rG[maxv];
vector<int> vs;
bool used[maxv];
int cmp[maxv];
void dfs(int v) {
  used[v] = true;
  for (unsigned i = 0; i < G[v].size(); i++)
    if (!used[G[v][i]]) dfs(G[v][i]);
  vs.push_back(v);
}
void rdfs(int v, int k) {
  used[v] = true;
  cmp[v] = k;
  for (unsigned i = 0; i < rG[v].size(); i++)
    if (!used[rG[v][i]]) rdfs(rG[v][i], k);
}
int scc() {
  memset(used, 0, sizeof(used));
  vs.clear();
  for (int v = 0; v < V; v++)
    if (!used[v]) dfs(v);
  memset(used, 0, sizeof(used));
  int k = 0;
  for (int i = vs.size() - 1; i >= 0; i--)
    if (!used[vs[i]]) rdfs(vs[i], k++);
  return k;
}
int n, m, k, cnt[maxv], cn;
bool is[maxv], val[maxv];
void print() {
  for (int i = 0; i < cn; ++i) printf("%d%c", cnt[i], i + 1 == cn ? '\n' : ' ');
  for (int i = 0; i < cn; ++i) printf("%d%c", val[i], i + 1 == cn ? '\n' : ' ');
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  V = n;
  for (int i = 0; i < k; ++i) {
    int ta;
    scanf("%d", &ta);
    --ta;
    is[ta] = true;
  }
  for (int i = 0; i < m; ++i) {
    int ta, tb;
    scanf("%d%d", &ta, &tb);
    --ta;
    --tb;
    G[ta].push_back(tb);
    G[tb].push_back(ta);
    rG[ta].push_back(tb);
    rG[tb].push_back(ta);
  }
  cn = scc();
  int res = 0, rev = 0, tmax = 0;
  for (int i = 0; i < n; ++i) {
    ++cnt[cmp[i]];
    if (is[i]) val[cmp[i]] = true;
  }
  for (int i = 0; i < cn; ++i)
    if (val[i]) {
      tmax = max(tmax, cnt[i]);
      res += (cnt[i] * (cnt[i] - 1)) / 2;
    } else
      rev += cnt[i];
  res -= (tmax * (tmax - 1)) / 2;
  tmax += rev;
  res += (tmax * (tmax - 1)) / 2;
  printf("%d\n", res - m);
  return 0;
}
