




def __UpperCamelCase			(       _A = 1000000  ):
						lowerCAmelCase_      			=  set(range(3 ,  _A ,  2  )  )
						primes.add(2  )
						for p in range(3 ,  _A ,  2  ):
												if p not in primes:
																		continue
												primes.difference_update(set(range(p * p ,  _A ,  _A  )  )  )

						lowerCAmelCase_      			=  [float(_A  ) for n in range(limit + 1  )]

						for p in primes:
												for n in range(_A ,  limit + 1 ,  _A  ):
																		phi[n] *= 1 - 1 / p

						return int(sum(phi[2:]  )  )


if __name__ == "__main__":
						print(f"{solution() = }")










import unittest

from transformers import is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device


if is_torch_available():
						import torch

						from transformers import AutoModelForImageClassification

if is_vision_available():
						from transformers import AutoImageProcessor


@require_torch
@require_vision
class  A		(  unittest.TestCase     ):



		@slow
		def        SCREAMING_SNAKE_CASE__			(     self   ):







								"""simple docstring"""



								lowerCAmelCase_      			=  AutoImageProcessor.from_pretrained('''microsoft/dit-base-finetuned-rvlcdip'''   )
								lowerCAmelCase_      			=  AutoModelForImageClassification.from_pretrained('''microsoft/dit-base-finetuned-rvlcdip'''   )
								model.to(UpperCamelCase__   )

								from datasets import load_dataset

								lowerCAmelCase_      			=  load_dataset('''nielsr/rvlcdip-demo'''   )

								lowerCAmelCase_      			=  dataset['''train'''][0]['''image'''].convert('''RGB'''   )

								lowerCAmelCase_      			=  image_processor(UpperCamelCase__,	return_tensors='''pt'''   ).to(UpperCamelCase__   )

								# forward pass
								with torch.no_grad():
														lowerCAmelCase_      			=  model(**UpperCamelCase__   )
														lowerCAmelCase_      			=  outputs.logits

								lowerCAmelCase_      			=  torch.Size((1, 16)   )
								self.assertEqual(logits.shape,	UpperCamelCase__   )

								lowerCAmelCase_      			=  torch.tensor(
								    [-0.4_158, -0.4_092, -0.4_347],	device=UpperCamelCase__,	dtype=torch.float,	)
								self.assertTrue(torch.allclose(logits[0, :3],	UpperCamelCase__,	atol=1E-4   )   )




