




from __future__ import annotations






def    snake_case   (				A     )				->				Tuple:




	'''simple docstring'''


	global graph, reversed_graph, scc, component, visit, stack
	if visit[u]:
		return
	lowerCamelCase_				:						Optional[Any]				  =				True
	for v in graph[u]:
		dfs(A     )
	stack.append(A     )






def    snake_case   (				A     )				->				List[str]:




	'''simple docstring'''


	global graph, reversed_graph, scc, component, visit, stack
	if visit[u]:
		return
	lowerCamelCase_				:						Dict				  =				True
	component.append(A     )
	for v in reversed_graph[u]:
		dfsa(A     )






def    snake_case   (				)				->				Dict:




	'''simple docstring'''


	global graph, reversed_graph, scc, component, visit, stack
	for i in range(A     ):
		dfs(A     )
	lowerCamelCase_				:						List[str]				  =				[False] * n
	for i in stack[::-1]:
		if visit[i]:
			continue
		lowerCamelCase_				:						str				  =				[]
		dfsa(A     )
		scc.append(A     )
	return scc


if __name__ == "__main__":
							# n - no of nodes, m - no of edges
							UpperCamelCase__			,					UpperCamelCase__						=		list(map(int, input().strip().split()))

							UpperCamelCase__						=		[[] for _ in range(n)]  # graph
							UpperCamelCase__						=		[[] for i in range(n)]  # reversed graph
							# input graph data (edges)
							for _ in range(m):
														UpperCamelCase__			,					UpperCamelCase__						=		list(map(int, input().strip().split()))
														graph[u].append(v)
														reversed_graph[v].append(u)

							UpperCamelCase__						=		[]
							UpperCamelCase__						=		[False] * n
							UpperCamelCase__						=		[]
							UpperCamelCase__						=		[]
							print(kosaraju())






UpperCamelCase__						=		[
    [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0],
    [0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0],
]






def    snake_case   (				A		,  A		,  A		,  A     )				->				bool:




	'''simple docstring'''


	return 0 <= row < rows and 0 <= col < cols






def    snake_case   (				A		,  A		,  A		,  A     )				->				int:




	'''simple docstring'''


	lowerCamelCase_				:						List[str]				  =				len(A     )
	lowerCamelCase_				:						Any				  =				len(mat[0]     )
	if is_safe(A		,  A		,  A		,  A     ) and (row, col) not in seen and mat[row][col] == 1:
		seen.add((row, col)     )
		return (
		    1
		    + depth_first_search(row + 1		,  A		,  A		,  A     )
		    + depth_first_search(row - 1		,  A		,  A		,  A     )
		    + depth_first_search(A		,  col + 1		,  A		,  A     )
		    + depth_first_search(A		,  col - 1		,  A		,  A     )
		)
	else:
		return 0






def    snake_case   (				A     )				->				int:




	'''simple docstring'''


	lowerCamelCase_				:						set				  =				set()

	lowerCamelCase_				:						Optional[Any]				  =				0
	for row, line in enumerate(A     ):
		for col, item in enumerate(A     ):
			if item == 1 and (row, col) not in seen:
				# Maximizing the area
				lowerCamelCase_				:						Optional[Any]				  =				max(A		,  depth_first_search(A		,  A		,  A		,  A     )     )
	return max_area


if __name__ == "__main__":
							import doctest

							print(find_max_area(matrix))  # Output -> 6
							doctest.testmod()
