func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, k;   long long cnt, sum, mx, ans = 0;   bool flag, gov[1010], vis[1010];   vector<int> vec, edges[1010];   void dfs(int u) {     vis[u] = 1;     for (int v : edges[u])       if (!vis[v]) dfs(v);     ++cnt;     flag |= gov[u];   }   int main() {     int u, v, i;     cin >> n >> m >> k;     for (i = 0; i < k; ++i) {       scanf( %d , &u);       gov[u] = 1;     }     for (i = 0; i < m; ++i) {       scanf( %d %d , &u, &v);       edges[u].push_back(v);       edges[v].push_back(u);     }     for (i = 1; i <= n; ++i) {       if (vis[i]) continue;       cnt = flag = 0;       dfs(i);       ans += cnt * (cnt - 1) / 2;       if (flag)         mx = max(mx, cnt);       else         vec.push_back(cnt);     }     for (int v : vec) {       ans += mx * v;       mx += v;     }     cout << ans - m << endl;     return 0;   }   