#include <bits/stdc++.h>
using namespace std;
int n, m, k, vis[1005], cnt[1005], mp[1005], VIS[1005];
vector<int> v[1005];
vector<int> special;
vector<int> nodes;
int CNT = 0;
void dfs(int start, int par = -1) {
  vis[start] = 1;
  CNT++;
  for (int i = 0; i < v[start].size(); i++) {
    int curr = v[start][i];
    if (vis[curr] || curr == par) continue;
    dfs(curr, start);
  }
}
void solve() {
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  for (int i = 0; i < k; i++) {
    int temp;
    scanf("%d", &temp);
    special.push_back(temp);
  }
  for (int i = 0; i < m; i++) {
    int from, to;
    scanf("%d", &from);
    scanf("%d", &to);
    v[from].push_back(to);
    v[to].push_back(from);
  }
  memset(vis, 0, sizeof(vis));
  memset(cnt, 0, sizeof(cnt));
  memset(VIS, 0, sizeof(VIS));
  long long ans = 0;
  int maxx = 0;
  memset(mp, 0, sizeof(mp));
  for (int i = 0; i < special.size(); i++) {
    mp[special[i]] = 1;
    CNT = 0;
    dfs(special[i]);
    int val = CNT;
    ans += (val * (val - 1)) / 2;
    maxx = max(maxx, val);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cnt += (!vis[i]);
  }
  ans += (cnt * (cnt - 1)) / 2;
  ans += (cnt * maxx);
  cout << max(0ll, ans - m);
}
int main() {
  solve();
  return 0;
}
