




"""simple docstring"""




from __future__ import annotations

from collections.abc import Callable
from typing import Generic, TypeVar

lowerCAmelCase				:     List[str]					=				TypeVar("""T""")
lowerCAmelCase				:     Optional[Any]					=				TypeVar("""U""")






class        __magic_name__				(			Generic[T, U]							):






				'''simple docstring'''





				def __init__(			self						,					_a						,					_a					):





							"""simple docstring"""
							lowerCamelCase      =   key
							lowerCamelCase      =   val
							lowerCamelCase      =   None
							lowerCamelCase      =   None





				def __repr__(			self					):





							"""simple docstring"""
							return (
							    f'Node: key: {self.key}, val: {self.val}, '
							    f'has next: {bool(self.next					)}, has prev: {bool(self.prev					)}'
							)






class        __magic_name__				(			Generic[T, U]							):






				'''simple docstring'''





				def __init__(			self					):





							"""simple docstring"""
							lowerCamelCase      =   DoubleLinkedListNode(_a						,					_a					)
							lowerCamelCase      =   DoubleLinkedListNode(_a						,					_a					)
							lowerCamelCase ,  lowerCamelCase      =   self.rear, self.head





				def __repr__(			self					):





							"""simple docstring"""
							lowerCamelCase      =   ["""DoubleLinkedList"""]
							lowerCamelCase      =   self.head
							while node.next is not None:
										rep.append(str(_a					)					)
										lowerCamelCase      =   node.next
							rep.append(str(self.rear					)					)
							return ",\n    ".join(_a					)





				def   _lowerCAmelCase							(			self						,					_a					):





							"""simple docstring"""
							lowerCamelCase      =   self.rear.prev

							# All nodes other than self.head are guaranteed to have non-None previous
							assert previous is not None

							lowerCamelCase      =   node
							lowerCamelCase      =   previous
							lowerCamelCase      =   node
							lowerCamelCase      =   self.rear





				def   _lowerCAmelCase							(			self						,					_a					):





							"""simple docstring"""

							if node.prev is None or node.next is None:
										return None

							lowerCamelCase      =   node.next
							lowerCamelCase      =   node.prev
							lowerCamelCase      =   None
							lowerCamelCase      =   None
							return node






class        __magic_name__				(			Generic[T, U]							):






				'''simple docstring'''
				__UpperCamelCase         =		{}





				def __init__(			self						,					_a					):





							"""simple docstring"""
							lowerCamelCase      =   DoubleLinkedList()
							lowerCamelCase      =   capacity
							lowerCamelCase      =   0
							lowerCamelCase      =   0
							lowerCamelCase      =   0
							lowerCamelCase      =   {}





				def __repr__(			self					):





							"""simple docstring"""
							return (
							    f'CacheInfo(hits={self.hits}, misses={self.miss}, '
							    f'capacity={self.capacity}, current size={self.num_keys})'
							)





				def __contains__(			self						,					_a					):





							"""simple docstring"""
							return key in self.cache





				def   _lowerCAmelCase							(			self						,					_a					):





							"""simple docstring"""
							# Note: pythonic interface would throw KeyError rather than return None

							if key in self.cache:
										self.hits += 1
										lowerCamelCase      =   self.cache[key]
										lowerCamelCase      =   self.list.remove(self.cache[key]					)
										assert node == value_node

										# node is guaranteed not None because it is in self.cache
										assert node is not None
										self.list.add(_a					)
										return node.val
							self.miss += 1
							return None





				def   _lowerCAmelCase							(			self						,					_a						,					_a					):





							"""simple docstring"""

							if key not in self.cache:
										if self.num_keys >= self.capacity:
													# delete first node (oldest) when over capacity
													lowerCamelCase      =   self.list.head.next

													# guaranteed to have a non-None first node when num_keys > 0
													# explain to type checker via assertions
													assert first_node is not None
													assert first_node.key is not None
													assert (
													    self.list.remove(_a					) is not None
													)  # node guaranteed to be in list assert node.key is not None

													del self.cache[first_node.key]
													self.num_keys -= 1
										lowerCamelCase      =   DoubleLinkedListNode(_a						,					_a					)
										self.list.add(self.cache[key]					)
										self.num_keys += 1

							else:
										# bump node to the end of the list, update value
										lowerCamelCase      =   self.list.remove(self.cache[key]					)
										assert node is not None  # node guaranteed to be in list
										lowerCamelCase      =   value
										self.list.add(_a					)





				@classmethod
				def   _lowerCAmelCase							(			cls						,					_a = 128					):





							"""simple docstring"""

							def cache_decorator_inner(_a					) -> Callable[..., U]:
										def cache_decorator_wrapper(*_a					) -> U:
													if func not in cls.decorator_function_to_instance_map:
																lowerCamelCase      =   LRUCache(_a					)

													lowerCamelCase      =   cls.decorator_function_to_instance_map[func].get(args[0]					)
													if result is None:
																lowerCamelCase      =   func(*_a					)
																cls.decorator_function_to_instance_map[func].put(args[0]						,					_a					)
													return result

										def cache_info() -> LRUCache[T, U]:
													return cls.decorator_function_to_instance_map[func]

										setattr(_a						,					"""cache_info"""						,					_a					)  # noqa: B010

										return cache_decorator_wrapper

							return cache_decorator_inner


if __name__ == "__main__":
					import doctest

					doctest.testmod()









"""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())))



