#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e5 + 500;
const long long mod = 1e9 + 7;
const long long inf = 1e18 + 500;
const long long MAXLOG = 20;
long long res = 0, num;
vector<long long> G[1010];
bool visit[1010];
long long g[1010];
vector<long long> v1;
vector<long long> v2;
void dfs(int v) {
  num++;
  visit[v] = 1;
  res += G[v].size();
  for (int i = 0; i < G[v].size(); i++) {
    if (!visit[G[v][i]]) {
      dfs(G[v][i]);
    }
  }
}
set<pair<long long, long long> > st;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, k, maxx = 0, x, y;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> g[i];
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  long long ans = 0;
  for (int i = 0; i < k; i++) {
    if (!visit[g[i]]) {
      res = 0;
      num = 0;
      dfs(g[i]);
      res /= 2;
      ans = ans + (num * (num - 1) / 2) - res;
      v1.push_back(num);
    }
  }
  for (int i = 0; i < n; i++) {
    if (!visit[i + 1]) {
      res = 0;
      num = 0;
      dfs(i + 1);
      res /= 2;
      ans = ans + (num * (num - 1) / 2) - res;
      v2.push_back(num);
    }
  }
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  long long sum = 0, now = 0;
  for (int i = 0; i < v2.size(); i++) sum += v2[i];
  for (int i = 0; i < v2.size(); i++) now += ((sum - v2[i]) * v2[i]);
  now /= 2;
  ans += now;
  ans += (sum * v1[k - 1]);
  cout << ans;
}
