#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const long long int N = 1e5 + 5;
const long long int INF = 1e10;
long long int mod = 998244353;
long long int dx[4] = {0, 0, +1, -1};
long long int dy[4] = {+1, -1, 0, 0};
long long int n, m, k;
long long int tt, cnt, vis[N], h[N];
vector<long long int> v[N];
void dfs(long long int u) {
  vis[u] = 1;
  for (auto to : v[u]) {
    if (!vis[to]) {
      cnt++;
      dfs(to);
    }
  }
}
void solve() {
  cin >> n >> m >> k;
  vector<long long int> kt(k, 0);
  for (long long int i = 0; i < k; i++) {
    cin >> kt[i];
    h[kt[i]] = 1;
  }
  for (long long int i = 1; i < m + 1; i++) {
    long long int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  vector<long long int> wz, wo;
  for (long long int i = 1; i < n + 1; i++) {
    if (!vis[i] and h[i] == 1) {
      dfs(i);
      wo.push_back(cnt + 1);
    }
    cnt = 0;
  }
  sort(wo.rbegin(), wo.rend());
  for (long long int i = 1; i < n + 1; i++) {
    cnt = 0;
    if (!vis[i]) {
      dfs(i);
      wo[0] += (cnt + 1);
    }
  }
  for (long long int i = 0; i < (long long int)wo.size(); i++) {
    tt += ((wo[i] * (wo[i] - 1)) / 2);
  }
  cout << tt - m << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  while (t--) solve();
  return 0;
}
