#include <bits/stdc++.h>
long long mpow(long long a, long long n, long long mod) {
  long long ret = 1;
  long long b = a;
  while (n) {
    if (n & 1) ret = (ret * b) % mod;
    b = (b * b) % mod;
    n >>= 1;
  }
  return (long long)ret;
}
inline void read(int &x) {
  x = 0;
  register char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    ;
  for (; c >= '0' && c <= '9'; c = getchar())
    x = (x << 3) + (x << 1) + (c - '0');
}
inline void write(int x) {
  register char buffor[35];
  register int i = 0;
  do {
    buffor[i++] = (x % 10) + '0';
    x /= 10;
  } while (x);
  i--;
  while (i >= 0) putchar(buffor[i--]);
  putchar('\n');
}
inline int in() {
  int x;
  read(x);
  return x;
}
void solve();
int dbg = 1;
using namespace std;
int main() {
  int t = 1;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
int vi[100005], edges[100005], ver[100005], maxd, maxv, arr[100005];
vector<int> vec[100005];
void dfs(int cu, int st) {
  if (vi[cu]) return;
  vi[cu] = 1;
  edges[st] += vec[cu].size();
  ver[st]++;
  if (ver[st] > maxv) {
    maxv = ver[st];
    maxd = st;
  }
  for (int i = 0; i < vec[cu].size(); i++) dfs(vec[cu][i], st);
}
void solve() {
  int n, m, k, ans = 0, c = 0, x, y;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> arr[i];
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    vec[x].push_back(y);
    vec[y].push_back(x);
  }
  for (int i = 0; i < k; i++) {
    arr[i]--;
    dfs(arr[i], arr[i]);
    int st = arr[i];
    ans += (ver[st] * (ver[st] - 1) / 2);
  }
  for (int i = 0; i < n; i++)
    if (!vi[i]) c++;
  ans += c * (c - 1) / 2;
  ans += c * maxv;
  ans -= m;
  cout << ans << endl;
}
