#include <bits/stdc++.h>
using namespace std;
vector<int> s;
vector<pair<int, int> > v;
vector<vector<int> > g;
vector<bool> used;
map<int, int> mp;
int c[1005];
int cl[1005];
int cr[1005];
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, k;
  cin >> n >> m >> k;
  g.resize(n);
  for (int i = 0; i < k; i++) {
    int x;
    cin >> x;
    x--;
    s.push_back(x);
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    v.push_back({a, b});
    g[a].push_back(b);
    g[b].push_back(a);
  }
  int ck = 0;
  queue<int> q;
  used.resize(n + 5, 0);
  mp[0] = n;
  for (int i = 0; i < k; i++) {
    q.push(s[i]);
    ck++;
    while (!q.empty()) {
      int vc = q.front();
      c[vc] = ck;
      used[vc] = 1;
      for (int i = 0; i < g[vc].size(); i++) {
        if (!used[g[vc][i]]) q.push(g[vc][i]);
      }
      q.pop();
    }
  }
  for (int i = 0; i < n; i++) {
    cl[c[i]]++;
  }
  for (int i = 0; i < m; i++) {
    int x = v[i].first;
    cr[c[x]]++;
  }
  long long mx = 0;
  int num = -1;
  for (int i = 1; i <= ck; i++) {
    long long cur = (cl[i] + cl[0]) * (cl[i] + cl[0] - 1) - cr[i] - cr[0];
    if (cur > mx) {
      mx = cur;
      num = i;
    }
  }
  cl[num] += cl[0];
  cr[num] += cr[0];
  long long ans = 0;
  for (int i = 1; i <= ck; i++) {
    ans += cl[i] * (cl[i] - 1) / 2 - cr[i];
  }
  cout << ans;
  return 0;
}
