



def       lowercase       (   SCREAMING_SNAKE_CASE__       :	Any = 1_000_000				)  ->     int:
	_snake_case    :  Union[str, Any]					=					[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				,       __SCREAMING_SNAKE_CASE				):
				phi[j] -= phi[j] // i

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


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





def       lowercase       (   SCREAMING_SNAKE_CASE__       :	int = 1_000				)  ->     int:
 _snake_case	,    _snake_case    :  str					=					1, 1
 _snake_case    :  List[Any]					=					2
 while True:
  _snake_case    :  Union[str, Any]					=					0
  _snake_case    :  int					=					fa + fa
  _snake_case	,    _snake_case    :  Union[str, Any]					=					fa, f
  index += 1
  for _ in str(SCREAMING_SNAKE_CASE__				):
   i += 1
  if i == n:
   break
 return index


if __name__ == "__main__":
  print(solution(int(str(input()).strip())))
