Hongcow is ruler of the world. As ruler of the world, he wants to make it easier for people to travel by road within their own countries.

The world can be modeled as an undirected graph with *n* nodes and *m* edges. *k* of the nodes are home to the governments of the *k* countries that make up the world.

There is at most one edge connecting any two nodes and no edge connects a node to itself. Furthermore, for any two nodes corresponding to governments, there is no path between those two nodes. Any graph that satisfies all of these conditions is stable.

Hongcow wants to add as many edges as possible to the graph while keeping it stable. Determine the maximum number of edges Hongcow can add.
The first line of input will contain three integers *n*, *m* and *k* (1 ≤ *n* ≤ 1 000, 0 ≤ *m* ≤ 100 000, 1 ≤ *k* ≤ *n*) — the number of vertices and edges in the graph, and the number of vertices that are homes of the government. 

The next line of input will contain *k* integers *c*<sub class="lower-index">1</sub>, *c*<sub class="lower-index">2</sub>, ..., *c*<sub class="lower-index">*k*</sub> (1 ≤ *c*<sub class="lower-index">*i*</sub> ≤ *n*). These integers will be pairwise distinct and denote the nodes that are home to the governments in this world.

The following *m* lines of input will contain two integers *u*<sub class="lower-index">*i*</sub> and *v*<sub class="lower-index">*i*</sub> (1 ≤ *u*<sub class="lower-index">*i*</sub>, *v*<sub class="lower-index">*i*</sub> ≤ *n*). This denotes an undirected edge between nodes *u*<sub class="lower-index">*i*</sub> and *v*<sub class="lower-index">*i*</sub>.

It is guaranteed that the graph described by the input is stable.
For the first sample test, the graph looks like this: 

For the second sample test, the graph looks like this:
4 1 2
1 3
1 2
2
3 3 1
2
1 2
1 3
2 3
0
10 3 2
1 10
1 2
1 3
4 5
33
1 0 1
1
0
1000 0 1
72
499500
24 38 2
4 13
7 1
24 1
2 8
17 2
2 18
22 2
23 3
5 9
21 5
6 7
6 19
6 20
11 7
7 20
13 8
16 8
9 10
14 9
21 9
12 10
10 22
23 10
17 11
11 24
20 12
13 16
13 23
15 14
17 14
14 20
19 16
17 20
17 23
18 22
18 23
22 19
21 20
23 24
215
10 30 1
4
1 2
3 1
4 1
1 6
1 8
10 1
2 4
2 7
3 4
3 5
7 3
3 9
10 3
5 4
6 4
7 4
9 4
10 4
6 5
5 8
9 5
10 5
6 7
9 6
10 6
7 8
9 7
10 7
9 8
10 8
15
10 13 2
5 10
2 1
1 4
2 3
2 8
3 4
7 3
4 6
8 4
4 9
6 7
6 9
10 6
7 8
23
10 10 3
2 5 6
1 3
4 1
4 3
5 3
3 9
8 4
9 4
5 10
8 7
10 8
18
10 5 3
1 5 9
1 3
1 8
2 3
8 4
5 7
17
6 4 2
1 4
1 2
2 3
4 5
5 6
2
7 8 2
1 4
1 2
2 3
4 5
4 6
4 7
5 6
5 7
6 7
1
5 2 3
1 3 4
1 5
2 4
0
5 3 2
1 2
2 3
2 4
1 5
1
9 5 2
1 5
1 2
2 3
3 4
5 6
6 7
13
6 4 1
1
2 3
3 4
4 5
5 6
11
6 4 2
1 5
1 2
2 3
3 4
5 6
3
7 3 3
1 5 6
1 2
1 3
6 7
4
5 2 2
1 2
1 3
2 4
2
11 7 2
1 4
1 2
1 3
4 5
4 6
5 6
9 10
1 11
24
20 4 5
1 3 9 10 20
5 6
1 2
7 9
4 10
89
n,m,k = map(int,input().split())
c = list(map(int,input().split()))
cc = c[:]
coord = [-1]*(n+1)
for i in range(1,n+1):
  if i in c:
    coord[i] = i

edges = []
edges_neis = []
for i in range(k):
  edges_neis.append([])
neis = []
v = [0]*(n+1)

for i in range(k):
  neis.append([c[i]])

for i in range(m):
  a,b = map(int,input().split())
  edges.append((a,b))
  if a in cc:
    aa = coord[a]
    coord[b] = aa
    index = c.index(aa)
    if (a,b) not in edges_neis[index]:
      edges_neis[index].append((a,b))
    if b not in neis[index]:
      neis[index].append(b)
    cc.append(b)
      
  if b in cc:
    bb = coord[b]
    coord[a] = bb
    index = c.index(bb)
    if (a,b) not in edges_neis[index]:
      edges_neis[index].append((a,b))
    if a not in neis[index]:
      neis[index].append(a)
    cc.append(a)
  v[a] = 1
  v[b] = 1

#print(v)
add = 0
for i in range(1,len(v)):
  if v[i]==0 and i not in c:
    add+=1


num = 0
max_len = 0
for i in range(k):
  #print('edges_neis[i]',edges_neis[i])
  l = len(neis[i])
  if l>max_len:
    max_len = l 
  num = num + int(l*(l-1)/2) - len(edges_neis[i])
  
#print(num)  
#print(max_len)
#print(add)
#print('-----------')
num = num + max_len*add + int(add*(add-1)/2)

print(num)

