

'''simple docstring'''

import numpy as np
import PIL
import torch
import torchvision.transforms as T
import torchvision.transforms.functional as TF
from PIL import Image





def 				A_					(	snake_case ,    snake_case=256	):
  SCREAMING_SNAKE_CASE:Union[str, Any]   =   min(img.size	)

  if s < target_image_size:
    raise ValueError(F'''min dim for image {s} < {target_image_size}'''	)

  SCREAMING_SNAKE_CASE:Optional[Any]   =   target_image_size / s
  SCREAMING_SNAKE_CASE:int   =   (round(r * img.size[1]	), round(r * img.size[0]	))
  SCREAMING_SNAKE_CASE:Tuple   =   TF.resize(snake_case ,    snake_case ,    interpolation=PIL.Image.LANCZOS	)
  SCREAMING_SNAKE_CASE:Dict   =   TF.center_crop(snake_case ,    output_size=2 * [target_image_size]	)
  SCREAMING_SNAKE_CASE:List[str]   =   torch.unsqueeze(T.ToTensor()(snake_case	) ,    0	)
  return img





def 				A_					(	snake_case	):
  SCREAMING_SNAKE_CASE:Optional[Any]   =   2.0 * x - 1.0
  return x





def 				A_					(	snake_case ,    snake_case=True ,    snake_case="RGB"	):
  SCREAMING_SNAKE_CASE:Dict   =   x.detach().cpu()
  if process:
    SCREAMING_SNAKE_CASE:Optional[int]   =   post_process_tensor(snake_case	)
  SCREAMING_SNAKE_CASE:int   =   x.numpy()
  if process:
    SCREAMING_SNAKE_CASE:Tuple   =   (255 * x).astype(np.uinta	)
  SCREAMING_SNAKE_CASE:Union[str, Any]   =   Image.fromarray(snake_case	)
  if not x.mode == mode:
    SCREAMING_SNAKE_CASE:List[Any]   =   x.convert(snake_case	)
  return x





def 				A_					(	snake_case	):
  SCREAMING_SNAKE_CASE:str   =   torch.clamp(snake_case ,    -1.0 ,    1.0	)
  SCREAMING_SNAKE_CASE:List[Any]   =   (x + 1.0) / 2.0
  SCREAMING_SNAKE_CASE:List[Any]   =   x.permute(1 ,    2 ,    0	)
  return x





def 				A_					(	snake_case	):
  SCREAMING_SNAKE_CASE:Optional[int]   =   post_process_tensor(x.squeeze()	)
  return x.permute(2 ,    0 ,    1	).unsqueeze(0	)









'''simple docstring'''

from collections import Counter





def 				A_					(	snake_case	):
  return sum(socks_by_color // 2 for socks_by_color in Counter(snake_case	).values()	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    A_      =							[int(x) for x in input("Enter socks by color :").rstrip().split()]
    print(f'''sock_merchant({colors}) = {sock_merchant(colors)}''')






