





'''simple docstring'''




import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_video_inputs


if is_torch_available():
  import torch

if is_vision_available():
  from PIL import Image

  from transformers import VivitImageProcessor


class  SCREAMING_SNAKE_CASE    (unittest.TestCase							):


     def __init__(						self						,	_UpperCAmelCase						,	_UpperCAmelCase=7						,	_UpperCAmelCase=3						,	_UpperCAmelCase=10						,	_UpperCAmelCase=18						,	_UpperCAmelCase=30						,	_UpperCAmelCase=400						,	_UpperCAmelCase=True						,	_UpperCAmelCase=None						,	_UpperCAmelCase=True						,	_UpperCAmelCase=[0.5, 0.5, 0.5]						,	_UpperCAmelCase=[0.5, 0.5, 0.5]						,	_UpperCAmelCase=None						,	):

          '''simple docstring'''






          __A						: List[str]      =       size if size is not None else {'shortest_edge': 18}
          __A						: int      =       crop_size if crop_size is not None else {'height': 18, 'width': 18}

          __A						: List[str]      =       parent
          __A						: str      =       batch_size
          __A						: int      =       num_channels
          __A						: List[str]      =       num_frames
          __A						: Union[str, Any]      =       image_size
          __A						: Optional[int]      =       min_resolution
          __A						: str      =       max_resolution
          __A						: Optional[int]      =       do_resize
          __A						: Optional[int]      =       size
          __A						: Dict      =       do_normalize
          __A						: List[Any]      =       image_mean
          __A						: int      =       image_std
          __A						: Union[str, Any]      =       crop_size


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          return {
              "image_mean": self.image_mean,
              "image_std": self.image_std,
              "do_normalize": self.do_normalize,
              "do_resize": self.do_resize,
              "size": self.size,
              "crop_size": self.crop_size,
          }




@require_torch
@require_vision
class  SCREAMING_SNAKE_CASE    (a__					,		unittest.TestCase							):
     lowerCAmelCase					=       VivitImageProcessor if is_vision_available() else None


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: List[str]      =       VivitImageProcessingTester(self)


     @property
     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          return self.image_processor_tester.prepare_image_processor_dict()


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Optional[int]      =       self.image_processing_class(**self.image_processor_dict)
          self.assertTrue(hasattr(A_						,	'image_mean'))
          self.assertTrue(hasattr(A_						,	'image_std'))
          self.assertTrue(hasattr(A_						,	'do_normalize'))
          self.assertTrue(hasattr(A_						,	'do_resize'))
          self.assertTrue(hasattr(A_						,	'do_center_crop'))
          self.assertTrue(hasattr(A_						,	'size'))


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: int      =       self.image_processing_class.from_dict(self.image_processor_dict)
          self.assertEqual(image_processor.size						,	{'shortest_edge': 18})
          self.assertEqual(image_processor.crop_size						,	{'height': 18, 'width': 18})

          __A						: Dict      =       self.image_processing_class.from_dict(self.image_processor_dict						,	size=42						,	crop_size=84)
          self.assertEqual(image_processor.size						,	{'shortest_edge': 42})
          self.assertEqual(image_processor.crop_size						,	{'height': 84, 'width': 84})


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: List[str]      =       self.image_processing_class(**self.image_processor_dict)
          # create random PIL videos
          __A						: Optional[Any]      =       prepare_video_inputs(self.image_processor_tester						,	equal_resolution=A_)
          for video in video_inputs:
               self.assertIsInstance(A_						,	A_)
               self.assertIsInstance(video[0]						,	Image.Image)

          # Test not batched input
          __A						: Optional[Any]      =       image_processing(video_inputs[0]						,	return_tensors='pt').pixel_values
          self.assertEqual(
              encoded_videos.shape						,	(
                  1,
                  self.image_processor_tester.num_frames,
                  self.image_processor_tester.num_channels,
                  self.image_processor_tester.crop_size['height'],
                  self.image_processor_tester.crop_size['width'],
              )						,	)

          # Test batched
          __A						: Dict      =       image_processing(A_						,	return_tensors='pt').pixel_values
          self.assertEqual(
              encoded_videos.shape						,	(
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_frames,
                  self.image_processor_tester.num_channels,
                  self.image_processor_tester.crop_size['height'],
                  self.image_processor_tester.crop_size['width'],
              )						,	)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: Dict      =       self.image_processing_class(**self.image_processor_dict)
          # create random numpy tensors
          __A						: Dict      =       prepare_video_inputs(self.image_processor_tester						,	equal_resolution=A_						,	numpify=A_)
          for video in video_inputs:
               self.assertIsInstance(A_						,	A_)
               self.assertIsInstance(video[0]						,	np.ndarray)

          # Test not batched input
          __A						: List[str]      =       image_processing(video_inputs[0]						,	return_tensors='pt').pixel_values
          self.assertEqual(
              encoded_videos.shape						,	(
                  1,
                  self.image_processor_tester.num_frames,
                  self.image_processor_tester.num_channels,
                  self.image_processor_tester.crop_size['height'],
                  self.image_processor_tester.crop_size['width'],
              )						,	)

          # Test batched
          __A						: int      =       image_processing(A_						,	return_tensors='pt').pixel_values
          self.assertEqual(
              encoded_videos.shape						,	(
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_frames,
                  self.image_processor_tester.num_channels,
                  self.image_processor_tester.crop_size['height'],
                  self.image_processor_tester.crop_size['width'],
              )						,	)


     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          __A						: int      =       self.image_processing_class(**self.image_processor_dict)
          # create random PyTorch tensors
          __A						: Optional[Any]      =       prepare_video_inputs(self.image_processor_tester						,	equal_resolution=A_						,	torchify=A_)
          for video in video_inputs:
               self.assertIsInstance(A_						,	A_)
               self.assertIsInstance(video[0]						,	torch.Tensor)

          # Test not batched input
          __A						: int      =       image_processing(video_inputs[0]						,	return_tensors='pt').pixel_values
          self.assertEqual(
              encoded_videos.shape						,	(
                  1,
                  self.image_processor_tester.num_frames,
                  self.image_processor_tester.num_channels,
                  self.image_processor_tester.crop_size['height'],
                  self.image_processor_tester.crop_size['width'],
              )						,	)

          # Test batched
          __A						: Dict      =       image_processing(A_						,	return_tensors='pt').pixel_values
          self.assertEqual(
              encoded_videos.shape						,	(
                  self.image_processor_tester.batch_size,
                  self.image_processor_tester.num_frames,
                  self.image_processor_tester.num_channels,
                  self.image_processor_tester.crop_size['height'],
                  self.image_processor_tester.crop_size['width'],
              )						,	)





def 			_SCREAMING_SNAKE_CASE			(							lowercase	:       int = 10_00     ):


      '''simple docstring'''



      lowerCamelCase_		     =    2**power
      lowerCamelCase_		     =    0
      while n:
            lowerCamelCase_     ,				lowerCamelCase_		     =    r + n % 10, n // 10
      return r


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



