#include <bits/stdc++.h>
using namespace std;
int visited[1005];
int main() {
  int n, m, k;
  int ret = 0;
  int nbvmax = 0;
  cin >> n >> m >> k;
  vector<int> gov;
  vector<vector<int> > graph(n);
  memset(visited, 0, sizeof visited);
  for (int i = 0; i < k; i++) {
    int a;
    cin >> a;
    a--;
    gov.push_back(a);
  }
  for (int i = 0; i < m; i++) {
    int c1, c2;
    cin >> c1 >> c2;
    c1--;
    c2--;
    graph[c1].push_back(c2);
    graph[c2].push_back(c1);
  }
  for (int i = 0; i < gov.size(); i++) {
    int nbedge = 0;
    int nbver = 1;
    int g = gov[i];
    queue<int> Q;
    Q.push(g);
    visited[g] = 1;
    while (!Q.empty()) {
      int d = Q.front();
      Q.pop();
      for (int j = 0; j < graph[d].size(); j++) {
        nbedge++;
        if (!visited[graph[d][j]]) {
          visited[graph[d][j]] = 1;
          Q.push(graph[d][j]);
          nbver++;
        }
      }
    }
    nbedge = nbedge / 2;
    if (nbver > 1)
      ret += nbver - 1 + ((nbver - 1) * (nbver - 2)) / 2;
    else
      ret += nbver - 1;
    ret -= nbedge;
    nbvmax = max(nbvmax, nbver);
  }
  int cc = 0;
  int edgeplus = 0;
  for (int i = 0; i < n; i++) {
    if (visited[i] == 0) {
      cc++;
      for (int j = 0; j < graph[i].size(); j++) {
        if (!visited[graph[i][j]]) edgeplus++;
      }
    }
  }
  edgeplus /= 2;
  ret += cc * nbvmax;
  if (cc > 1) ret += (cc * (cc - 1)) / 2;
  ret -= edgeplus;
  cout << ret << endl;
}
