For this Question: You have been given a graph consisting of N nodes and M edges. The nodes in this graph are enumerated from 1 to N . The graph can consist of self-loops as well as multiple edges. This graph consists of a special node called the head node. You need to consider this and the entry point of this graph. You need to find and print the number of nodes that are unreachable from this head node. (Using DFS)The first line consists of a 2 integers N and M denoting the number of nodes and edges in this graph. The next M lines consist of 2 integers a and b denoting an undirected edge between node a and b. The next line consists of a single integer x denoting the index of the head node.

Constraints
1<=N=100000
1<=M<=100000
1<=x<=NYou need to print a single integer denoting the number of nodes that are unreachable from the given head node.
Sample Input:
10 10
8 1
8 3
7 4
7 5
2 6
10 7
2 8
10 9
2 10
5 10
2

Sample Output :
0


Explanation : As from node 2 we can reach all vertices. Unreachable vertices  are zero., I have written this Solution Code: def dfs(grapg,s):
	stack=[]
	visited={}
	for v in grapg:
		visited[v]=0
	stack.append(s)
	visited[s]=1
	while(stack):
		s=stack.pop(-1)
		if(s in visited):
			visited[s]=1
		for i in grapg[s]:
			if(visited[str(i)]==0):
				stack.append(i)
				visited[i]=1
	count=0
	for i in visited:
		if(visited[i]==1):
			count+=1
	return count
dic={}
n,m=input().split()
n=int(n)
m=int(m)
for i in range(0,m):
	a,b=input().split()
	if(a not in dic):
		dic[a]=[b]
	else:
		dic[a].append(b)
	if(b not in dic):
		dic[b]=[a]
	else:
		dic[b].append(a)
s=input()
ans=dfs(dic,s)
print(n-ans), In this Programming Language: Python, Now tell me if this Code is compilable or not?