
import random
import unittest

import torch

from diffusers import IFImgaImgSuperResolutionPipeline
from diffusers.utils import floats_tensor
from diffusers.utils.import_utils import is_xformers_available
from diffusers.utils.testing_utils import skip_mps, torch_device

from ..pipeline_params import TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS, TEXT_GUIDED_IMAGE_VARIATION_PARAMS
from ..test_pipelines_common import PipelineTesterMixin
from . import IFPipelineTesterMixin




@skip_mps
class        UpperCAmelCase_			( _A  ,       _A  ,       unittest.TestCase     ):


  '''simple docstring'''







  a__           =		IFImgaImgSuperResolutionPipeline
  a__           =		TEXT_GUIDED_IMAGE_VARIATION_PARAMS - {"""width""", """height"""}
  a__           =		TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS.union({"""original_image"""}     )
  a__           =		PipelineTesterMixin.required_optional_params - {"""latents"""}
  def 							_lowercase							( self			: List[Any]    )			->	Optional[int]:







    """simple docstring"""






    return self._get_superresolution_dummy_components()
  def 							_lowercase							( self			: Optional[int]			,							UpperCamelCase__			: str			,							UpperCamelCase__			: Dict=0    )			->	Any:







    """simple docstring"""






    if str(UpperCamelCase__    ).startswith("""mps"""    ):
      __magic_name__				     =       torch.manual_seed(UpperCamelCase__    )
    else:
      __magic_name__				     =       torch.Generator(device=UpperCamelCase__    ).manual_seed(UpperCamelCase__    )

    __magic_name__				     =       floats_tensor((1, 3, 32, 32)			,							rng=random.Random(UpperCamelCase__    )    ).to(UpperCamelCase__    )
    __magic_name__				     =       floats_tensor((1, 3, 16, 16)			,							rng=random.Random(UpperCamelCase__    )    ).to(UpperCamelCase__    )

    __magic_name__				     =       {
        """prompt""": """A painting of a squirrel eating a burger""",
        """image""": image,
        """original_image""": original_image,
        """generator""": generator,
        """num_inference_steps""": 2,
        """output_type""": """numpy""",
    }

    return inputs
  @unittest.skipIf(
      torch_device != """cuda""" or not is_xformers_available()			,							reason="""XFormers attention is only available with CUDA and `xformers` installed"""			,							)
  def 							_lowercase							( self			: Optional[int]    )			->	List[Any]:







    """simple docstring"""






    self._test_xformers_attention_forwardGenerator_pass(expected_max_diff=1E-3    )
  def 							_lowercase							( self			: Union[str, Any]    )			->	Tuple:







    """simple docstring"""






    self._test_save_load_optional_components()
  @unittest.skipIf(torch_device != """cuda"""			,							reason="""float16 requires CUDA"""    )
  def 							_lowercase							( self			: Tuple    )			->	Union[str, Any]:







    """simple docstring"""






    super().test_save_load_floataa(expected_max_diff=1E-1    )
  def 							_lowercase							( self			: str    )			->	Optional[Any]:







    """simple docstring"""






    self._test_attention_slicing_forward_pass(expected_max_diff=1E-2    )
  def 							_lowercase							( self			: Optional[Any]    )			->	Optional[int]:







    """simple docstring"""






    self._test_save_load_local()





  def 							_lowercase							( self			: str    )			->	Dict:







    """simple docstring"""






    self._test_inference_batch_single_identical(
        expected_max_diff=1E-2			,							)





'''simple docstring'''






def 				UpperCamelCase_			(    A__					:   int = 1_00					):
  '''simple docstring'''





  lowerCAmelCase_			:      int			=   set()

  lowerCAmelCase_			:      Tuple			=   0

  lowerCAmelCase_			:      str			=   n + 1  # maximum limit

  for a in range(2							,    A__					):
    for b in range(2							,    A__					):
      lowerCAmelCase_			:      str			=   a**b  # calculates the current power
      collect_powers.add(A__					)  # adds the result to the set
  return len(A__					)


if __name__ == "__main__":
  print("Number of terms ", solution(int(str(input()).strip())))



