#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<long long, long long>, vector<pair<long long, long long> > >
    q;
map<pair<long long, long long>, long long> mii;
map<pair<long long, long long>, long long>::iterator iit1, iit2;
map<string, long long> msi;
map<string, long long>::iterator sit;
map<char, long long> mci;
map<char, long long>::iterator cit;
map<int, bool> mark;
map<int, bool>::iterator bit;
vector<long long> v[100010], v1;
vector<long long>::iterator vit;
bool vis[100010];
int c[100010];
pair<long long, long long> dfs(int src) {
  vis[src] = true;
  int res1 = 0, res2 = 0;
  for (int i = 0; i < v[src].size(); i++) {
    if (!vis[v[src][i]]) {
      pair<long long, long long> p = dfs(v[src][i]);
      res1 += p.first;
      res2 += p.second;
    }
  }
  iit1 = mii.lower_bound({src, 0}), iit2 = mii.lower_bound({src, 1000000007});
  return {res1 + 1, res2 + distance(iit1, iit2)};
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m, k, x, y;
  cin >> n >> m >> k;
  for (int i = 0; i < k; i++) cin >> c[i];
  for (int i = 0; i < m; i++)
    cin >> x >> y, v[x].push_back(y), v[y].push_back(x),
        mii[{min(x, y), max(x, y)}] = 1;
  long long ans = 0;
  for (int i = 0; i < k; i++) {
    pair<long long, long long> p = dfs(c[i]);
    v1.push_back(-p.first);
    ans += (p.first * (p.first - 1)) / 2 - p.second;
  }
  sort(v1.begin(), v1.end());
  for (int i = 0; i < v1.size(); i++) v1[i] = -v1[i];
  int p = 0, cnt = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cnt++;
      iit1 = mii.lower_bound({i, 0}), iit2 = mii.lower_bound({i, 1000000007});
      cnt2 -= distance(iit1, iit2);
    }
  }
  ans += v1[p] * cnt + (cnt * (cnt - 1)) / 2 + cnt2;
  cout << ans << "\n";
}
