#include <bits/stdc++.h>
const int M = 1e9 + 7;
const int N = 1e3 + 5;
using namespace std;
long long int govt[N], cnt;
long long int vis[N];
vector<long long int> v[N];
void dfs(long long int x) {
  if (vis[x]) return;
  vis[x] = 1;
  ++cnt;
  for (auto y : v[x]) {
    dfs(y);
  }
}
int main() {
  long long int n, m, k;
  cin >> n >> m >> k;
  for (long long int i = 0; i < k; ++i) {
    long long int x;
    cin >> x;
    govt[x] = 1;
  }
  for (long long int i = 0; i < m; ++i) {
    long long int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  priority_queue<long long int> q;
  long long int val = 0;
  for (long long int i = 1; i <= n; ++i) {
    if (!govt[i]) continue;
    cnt = 0;
    dfs(i);
    val += cnt;
    q.push(cnt);
  }
  long long int rem = n - val;
  long long int f = q.top() + rem;
  q.pop();
  q.push(f);
  long long int ans = 0;
  while (!q.empty()) {
    long long int g = q.top();
    q.pop();
    g = g * (g - 1) / 2;
    ans += g;
  }
  ans -= m;
  cout << ans;
}
