




def  UpperCAmelCase_							(				__UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     list							) ->			int:
      _enforce_args(__UpperCAmelCase      ,      __UpperCAmelCase							)
      if n == 0:
            return 0
      SCREAMING_SNAKE_CASE_     						=      float('-inf'							)
      for i in range(1      ,      n + 1							):
            SCREAMING_SNAKE_CASE_     						=      max(
                __UpperCAmelCase      ,      prices[i - 1] + naive_cut_rod_recursive(n - i      ,      __UpperCAmelCase							)							)

      return max_revue

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     list							) ->			str:
      _enforce_args(__UpperCAmelCase      ,      __UpperCAmelCase							)
      SCREAMING_SNAKE_CASE_     						=      [float('-inf'							) for _ in range(n + 1							)]
      return _top_down_cut_rod_recursive(__UpperCAmelCase      ,      __UpperCAmelCase      ,      __UpperCAmelCase							)

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     list      ,      __UpperCAmelCase						:     list							) ->			int:
      if max_rev[n] >= 0:
            return max_rev[n]
      elif n == 0:
            return 0
      else:
            SCREAMING_SNAKE_CASE_     						=      float('-inf'							)
            for i in range(1      ,      n + 1							):
                  SCREAMING_SNAKE_CASE_     						=      max(
                      __UpperCAmelCase      ,      prices[i - 1] + _top_down_cut_rod_recursive(n - i      ,      __UpperCAmelCase      ,      __UpperCAmelCase							)      ,      )

            SCREAMING_SNAKE_CASE_     						=      max_revenue

      return max_rev[n]

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     list							) ->			Tuple:
      _enforce_args(__UpperCAmelCase      ,      __UpperCAmelCase							)

      # length(max_rev) = n + 1, to accommodate for the revenue obtainable from a rod of
      # length 0.
      SCREAMING_SNAKE_CASE_     						=      [float('-inf'							) for _ in range(n + 1							)]
      SCREAMING_SNAKE_CASE_     						=      0

      for i in range(1      ,      n + 1							):
            SCREAMING_SNAKE_CASE_     						=      max_rev[i]
            for j in range(1      ,      i + 1							):
                  SCREAMING_SNAKE_CASE_     						=      max(__UpperCAmelCase      ,      prices[j - 1] + max_rev[i - j]							)

            SCREAMING_SNAKE_CASE_     						=      max_revenue_i

      return max_rev[n]

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int      ,      __UpperCAmelCase						:     list							) ->			Dict:
      if n < 0:
            SCREAMING_SNAKE_CASE_     						=      f"n must be greater than or equal to 0. Got n = {n}"
            raise ValueError(__UpperCAmelCase							)

      if n > len(__UpperCAmelCase							):
            SCREAMING_SNAKE_CASE_     						=      (
                'Each integral piece of rod must have a corresponding price. '
                f"Got n = {n} but length of prices = {len(__UpperCAmelCase							)}"
            )
            raise ValueError(__UpperCAmelCase							)

def  UpperCAmelCase_							(				) ->			str:
      SCREAMING_SNAKE_CASE_     						=      [6, 10, 12, 15, 20, 23]
      SCREAMING_SNAKE_CASE_     						=      len(__UpperCAmelCase							)

      # the best revenue comes from cutting the rod into 6 pieces, each
      # of length 1 resulting in a revenue of 6 * 6 = 36.
      SCREAMING_SNAKE_CASE_     						=      36

      SCREAMING_SNAKE_CASE_     						=      top_down_cut_rod(__UpperCAmelCase      ,      __UpperCAmelCase							)
      SCREAMING_SNAKE_CASE_     						=      bottom_up_cut_rod(__UpperCAmelCase      ,      __UpperCAmelCase							)
      SCREAMING_SNAKE_CASE_     						=      naive_cut_rod_recursive(__UpperCAmelCase      ,      __UpperCAmelCase							)

      assert expected_max_revenue == max_rev_top_down
      assert max_rev_top_down == max_rev_bottom_up
      assert max_rev_bottom_up == max_rev_naive


if __name__ == "__main__":
   main()





def  UpperCAmelCase_							(				) ->			int:
      return 1

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

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

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

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

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

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

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

def  UpperCAmelCase_							(				__UpperCAmelCase						:     int = 2_00							) ->			int:
      return two_pound(__UpperCAmelCase							)


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