




"""simple docstring"""







import os
from typing import BinaryIO, Optional, Union

import numpy as np
import pyarrow.parquet as pq

from .. import Audio, Dataset, Features, Image, NamedSplit, Value, config
from ..features.features import FeatureType, _visit
from ..formatting import query_table
from ..packaged_modules import _PACKAGED_DATASETS_MODULES
from ..packaged_modules.parquet.parquet import Parquet
from ..utils import logging
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader

def     snake_case__							(       _lowerCamelCase					)      ->Optional[int]:






		"""simple docstring"""


		__lowercase					:		str        =					np.inf

		def set_batch_size(_lowerCamelCase					) -> None:
				nonlocal batch_size
				if isinstance(snake_case__,	snake_case__					):
						__lowercase					:		Optional[int]        =					min(snake_case__,	config.PARQUET_ROW_GROUP_SIZE_FOR_IMAGE_DATASETS					)
				elif isinstance(snake_case__,	snake_case__					):
						__lowercase					:		List[Any]        =					min(snake_case__,	config.PARQUET_ROW_GROUP_SIZE_FOR_AUDIO_DATASETS					)
				elif isinstance(snake_case__,	snake_case__					) and feature.dtype == "binary":
						__lowercase					:		Tuple        =					min(snake_case__,	config.PARQUET_ROW_GROUP_SIZE_FOR_BINARY_DATASETS					)

		_visit(snake_case__,	snake_case__					)

		return None if batch_size is np.inf else batch_size




class    lowerCAmelCase__							(      UpperCAmelCase__     ):


				"""simple docstring"""





				def __init__(  self       :						Any     , lowercase__       :						Optional[Any]     , lowercase__       :						List[str] = None     , lowercase__       :						Dict = None     , lowercase__       :						Any = None     , lowercase__       :						List[Any] = False     , lowercase__       :						str = False     , lowercase__       :						List[str] = None     , **lowercase__       :						str     , ):
						super().__init__(
						    _a     , split=_a     , features=_a     , cache_dir=_a     , keep_in_memory=_a     , streaming=_a     , num_proc=_a     , **_a     , )
						__lowercase					:		Union[str, Any]        =					path_or_paths if isinstance(_a     , _a    ) else {self.split: path_or_paths}
						__lowercase					:		Tuple        =					_PACKAGED_DATASETS_MODULES["parquet"][1]
						__lowercase					:		Dict        =					Parquet(
						    cache_dir=_a     , data_files=_a     , features=_a     , hash=_a     , **_a     , )



				def    snake_case     (  self       :						Any    ):
						# Build iterable dataset
						if self.streaming:
								__lowercase					:		List[str]        =					self.builder.as_streaming_dataset(split=self.split    )
						# Build regular (map-style) dataset
						else:
								__lowercase					:		Dict        =					None
								__lowercase					:		Optional[Any]        =					None
								__lowercase					:		Any        =					None
								__lowercase					:		List[Any]        =					None

								self.builder.download_and_prepare(
								    download_config=_a     , download_mode=_a     , verification_mode=_a     , base_path=_a     , num_proc=self.num_proc     , )
								__lowercase					:		Union[str, Any]        =					self.builder.as_dataset(
								    split=self.split     , verification_mode=_a     , in_memory=self.keep_in_memory    )
						return dataset





class    lowerCAmelCase__							:


				"""simple docstring"""





				def __init__(  self       :						Optional[Any]     , lowercase__       :						List[Any]     , lowercase__       :						List[Any]     , lowercase__       :						Any = None     , **lowercase__       :						Optional[int]     , ):
						__lowercase					:		Optional[int]        =					dataset
						__lowercase					:		int        =					path_or_buf
						__lowercase					:		List[str]        =					batch_size or get_writer_batch_size(dataset.features    )
						__lowercase					:		Optional[int]        =					parquet_writer_kwargs



				def    snake_case     (  self       :						int    ):
						__lowercase					:		List[str]        =					self.batch_size if self.batch_size else config.DEFAULT_MAX_BATCH_SIZE

						if isinstance(self.path_or_buf     , (str, bytes, os.PathLike)    ):
								with open(self.path_or_buf     , "wb+"    ) as buffer:
										__lowercase					:		Union[str, Any]        =					self._write(file_obj=_a     , batch_size=_a     , **self.parquet_writer_kwargs    )
						else:
								__lowercase					:		List[Any]        =					self._write(file_obj=self.path_or_buf     , batch_size=_a     , **self.parquet_writer_kwargs    )
						return written



				def    snake_case     (  self       :						Optional[int]     , lowercase__       :						List[Any]     , lowercase__       :						int     , **lowercase__       :						Tuple    ):
						__lowercase					:		Union[str, Any]        =					0
						__lowercase					:		Dict        =					parquet_writer_kwargs.pop("path_or_buf"     , _a    )
						__lowercase					:		Dict        =					self.dataset.features.arrow_schema

						__lowercase					:		List[Any]        =					pq.ParquetWriter(_a     , schema=_a     , **_a    )

						for offset in logging.tqdm(
						    range(0     , len(self.dataset    )     , _a    )     , unit="ba"     , disable=not logging.is_progress_bar_enabled()     , desc="Creating parquet from Arrow format"     , ):
								__lowercase					:		str        =					query_table(
								    table=self.dataset._data     , key=slice(_a     , offset + batch_size    )     , indices=self.dataset._indices if self.dataset._indices is not None else None     , )
								writer.write_table(_a    )
								written += batch.nbytes
						writer.close()
						return written






"""simple docstring"""




def        a__					(							)		->   int:
			return 1



def        a__					(							snake_case__							)		->   int:
			return 0 if x < 0 else two_pence(x - 2							) + one_pence()



def        a__					(							snake_case__							)		->   int:
			return 0 if x < 0 else five_pence(x - 5							) + two_pence(snake_case__							)



def        a__					(							snake_case__							)		->   int:
			return 0 if x < 0 else ten_pence(x - 10							) + five_pence(snake_case__							)



def        a__					(							snake_case__							)		->   int:
			return 0 if x < 0 else twenty_pence(x - 20							) + ten_pence(snake_case__							)



def        a__					(							snake_case__							)		->   int:
			return 0 if x < 0 else fifty_pence(x - 50							) + twenty_pence(snake_case__							)



def        a__					(							snake_case__							)		->   int:
			return 0 if x < 0 else one_pound(x - 1_00							) + fifty_pence(snake_case__							)



def        a__					(							snake_case__							)		->   int:
			return 0 if x < 0 else two_pound(x - 2_00							) + one_pound(snake_case__							)



def        a__					(							snake_case__ = 2_00							)		->   int:
			return two_pound(snake_case__							)


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



