#include <bits/stdc++.h>
using namespace std;
const long long MX = 4e5 + 9;
const long double pi = acos(-1);
const long long mod = 1e9 + 7;
long long po(long long a, long long b) {
  if (b == 0) {
    return 1;
  }
  long long x = po(a, b / 2);
  x *= x % mod;
  if (b % 2) {
    x *= a % mod;
  }
  return x % mod;
}
int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b)); }
int dx[] = {0, 0, -1, 1, 1, -1, -1, 1};
int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
pair<int, int> a[MX];
int vis[MX];
vector<int> v[MX];
vector<pair<int, int> > c;
int ans[MX];
int cnt = 0;
int deg[MX];
bool adj[1005][1005];
void dfs(int x, int p, int cc) {
  if (vis[x]) {
    return;
  }
  vis[x] = cc;
  for (int i = 0; i < v[x].size(); i++) {
    int nxt = v[x][i];
    if (nxt == p) {
      continue;
    }
    dfs(nxt, x, cc);
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    cin >> a[i].first;
  }
  if (k == n - 1) {
    cout << n - 1;
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
    deg[x]++;
    deg[y]++;
    adj[x][y] = adj[y][x] = 1;
  }
  for (int i = 1; i <= k; i++) {
    cnt = 0;
    dfs(a[i].first, -1, a[i].first);
    for (int j = 1; j <= n; j++) {
      if (vis[j] == a[i].first) {
        cnt += deg[j];
      }
    }
    cnt /= 2;
    a[a[i].first].second = cnt;
  }
  int emp = 0;
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i]) {
      ans[vis[i]]++;
    } else {
      emp++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i]) {
      c.push_back(make_pair(ans[i], i));
    }
  }
  sort(c.rbegin(), c.rend());
  int no = c[0].first;
  int edg = c[0].second;
  res = (emp + no) * (emp + no - 1) / 2;
  for (int i = 1; i < c.size(); i++) {
    res += (c[i].first * (c[i].first - 1) / 2);
  }
  cout << res - m;
  return 0;
}
