






from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass


@dataclass
class 							__UpperCamelCase     :
	__snake_case						:int
	__snake_case						:int


class 							__UpperCamelCase     :







	def __init__(	self   :				Any							,					_lowerCAmelCase   :				int      )		->			List[str]:
		"""simple docstring"""







		__lowercase   							=	[[] for _ in range(_lowerCAmelCase      )]
		__lowercase   							=	size







	def __getitem__(	self   :				Tuple							,					_lowerCAmelCase   :				int      )		->			Iterator[Edge]:
		"""simple docstring"""







		return iter(self._graph[vertex]      )







	@property
	def 			_a (	self   :				str      )		->			Dict:
		"""simple docstring"""







		return self._size







	def 			_a (	self   :				Dict							,					_lowerCAmelCase   :				int							,					_lowerCAmelCase   :				int							,					_lowerCAmelCase   :				int      )		->			Tuple:
		"""simple docstring"""







		if weight not in (0, 1):
			raise ValueError("""Edge weight must be either 0 or 1."""      )

		if to_vertex < 0 or to_vertex >= self.size:
			raise ValueError("""Vertex indexes must be in [0; size)."""      )

		self._graph[from_vertex].append(Edge(_lowerCAmelCase							,					_lowerCAmelCase      )      )







	def 			_a (	self   :				List[Any]							,					_lowerCAmelCase   :				int							,					_lowerCAmelCase   :				int      )		->			int | None:
		"""simple docstring"""







		__lowercase   							=	deque([start_vertex]      )
		__lowercase   							=	[None] * self.size
		__lowercase   							=	0

		while queue:
			__lowercase   							=	queue.popleft()
			__lowercase   							=	distances[current_vertex]
			if current_distance is None:
				continue

			for edge in self[current_vertex]:
				__lowercase   							=	current_distance + edge.weight
				__lowercase   							=	distances[edge.destination_vertex]
				if (
				    isinstance(_lowerCAmelCase							,					_lowerCAmelCase      )
				    and new_distance >= dest_vertex_distance
				):
					continue
				__lowercase   							=	new_distance
				if edge.weight == 0:
					queue.appendleft(edge.destination_vertex      )
				else:
					queue.append(edge.destination_vertex      )

		if distances[finish_vertex] is None:
			raise ValueError("""No path from start_vertex to finish_vertex."""      )

		return distances[finish_vertex]


if __name__ == "__main__":
						import doctest

						doctest.testmod()







'''simple docstring'''



def   lowercase__(			__UpperCamelCase:					int = 1_00_00_00    ):

      """simple docstring"""






      SCREAMING_SNAKE_CASE   :      Tuple    					=						[i - 1 for i in range(limit + 1    )]

      for i in range(2      ,limit + 1    ):
            if phi[i] == i - 1:
                  for j in range(2 * i      ,limit + 1      ,__UpperCamelCase    ):
                        phi[j] -= phi[j] // i

      return sum(phi[2 : limit + 1]    )


if __name__ == "__main__":
      print(solution())


