#include <bits/stdc++.h>
using namespace std;
const int MAX = 112345;
bool gov[MAX], vis[MAX];
int n, m, k;
vector<int> edge[MAX];
vector<long long> ans;
long long total_v, total_e;
bool is_gov;
void dfs(int u) {
  vis[u] = true;
  if (gov[u]) is_gov = true;
  total_v++;
  total_e += edge[u].size();
  for (int i = 0; i < edge[u].size(); i++) {
    int v = edge[u][i];
    if (!vis[v]) dfs(v);
  }
}
int main() {
  cin >> n >> m >> k;
  for (int i = 1; i <= k; i++) {
    int t;
    cin >> t;
    gov[t] = true;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  long long sum = 0;
  long long max_gov = 0;
  for (int i = 1; i <= n; i++) {
    total_v = total_e = is_gov = 0;
    if (!vis[i]) {
      dfs(i);
      total_e /= 2;
      sum += (total_v * (total_v - 1)) / 2 - total_e;
      if (!is_gov)
        ans.push_back(total_v);
      else
        max_gov = max(max_gov, total_v);
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    long long t = ans[i];
    sum += max_gov * t;
    max_gov += t;
  }
  printf("%lld\n", sum);
}
