






"""simple docstring"""



import warnings
from collections.abc import Callable
from typing import Any

import numpy
from matplotlib import pyplot

_UpperCamelCase		:  List[str]						=		0.2_5 + 0.0J
_UpperCamelCase		:  int						=		-0.4 + 0.6J
_UpperCamelCase		:  Any						=		-0.1 + 0.651J
_UpperCamelCase		:  Any						=		-2.0
_UpperCamelCase		:  Dict						=		5_6
_UpperCamelCase		:  Union[str, Any]						=		2.0
_UpperCamelCase		:  str						=		6_6_6
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  complex		, __snake_case      :  numpy.ndarray   ):





  '''simple docstring'''





  return numpy.exp(__snake_case   ) + c_parameter
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  complex		, __snake_case      :  numpy.ndarray   ):





  '''simple docstring'''





  return z_values * z_values + c_parameter
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  float		, __snake_case      :  int   ):





  '''simple docstring'''





  lowercase							   =	numpy.linspace(-window_size		, __snake_case		, __snake_case   )
  lowercase							   =	x.reshape((nb_pixels, 1)   )
  lowercase							   =	numpy.linspace(-window_size		, __snake_case		, __snake_case   )
  lowercase							   =	y.reshape((1, nb_pixels)   )
  return x + 1.0j * y
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  Callable[[Any, numpy.ndarray], numpy.ndarray]		, __snake_case      :  Any		, __snake_case      :  int		, __snake_case      :  numpy.ndarray		, __snake_case      :  float | None = None		, ):





  '''simple docstring'''





  lowercase							   =	z_a.astype('complex64'   )
  for _ in range(__snake_case   ):
    lowercase							   =	eval_function(__snake_case		, __snake_case   )
    if infinity is not None:
      numpy.nan_to_num(__snake_case		, copy=__snake_case		, nan=__snake_case   )
      lowercase							   =	infinity
  return z_n
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  str		, __snake_case      :  Any		, __snake_case      :  float		, __snake_case      :  numpy.ndarray		, ):





  '''simple docstring'''





  lowercase							   =	(abs(__snake_case   )).transpose()
  lowercase							   =	abs_z_final[::-1, :]
  pyplot.matshow(abs_z_final < escape_radius   )
  pyplot.title(f'Julia set of ${function_label}$, $c={function_params}$'   )
  pyplot.show()
def 						_SCREAMING_SNAKE_CASE			(   ):





  '''simple docstring'''





  warnings.filterwarnings(
      'ignore'		, category=__snake_case		, message='overflow encountered in multiply'   )
  warnings.filterwarnings(
      'ignore'		, category=__snake_case		, message='invalid value encountered in multiply'		, )
  warnings.filterwarnings(
      'ignore'		, category=__snake_case		, message='overflow encountered in absolute'   )
  warnings.filterwarnings(
      'ignore'		, category=__snake_case		, message='overflow encountered in exp'   )


if __name__ == "__main__":
    _UpperCamelCase		:  Tuple						=		prepare_grid(window_size, nb_pixels)

    ignore_overflow_warnings()  # See file header for explanations

    _UpperCamelCase		:  Optional[Any]						=		2_4
    _UpperCamelCase		:  Dict						=		2 * abs(c_cauliflower) + 1
    _UpperCamelCase		:  str						=		iterate_function(
        eval_quadratic_polynomial,
        c_cauliflower,
        nb_iterations,
        z_a,
        infinity=1.1 * escape_radius,
    )
    show_results('z^2+c', c_cauliflower, escape_radius, z_final)

    _UpperCamelCase		:  int						=		6_4
    _UpperCamelCase		:  List[str]						=		2 * abs(c_polynomial_a) + 1
    _UpperCamelCase		:  Tuple						=		iterate_function(
        eval_quadratic_polynomial,
        c_polynomial_a,
        nb_iterations,
        z_a,
        infinity=1.1 * escape_radius,
    )
    show_results('z^2+c', c_polynomial_a, escape_radius, z_final)

    _UpperCamelCase		:  Any						=		1_6_1
    _UpperCamelCase		:  Optional[Any]						=		2 * abs(c_polynomial_a) + 1
    _UpperCamelCase		:  int						=		iterate_function(
        eval_quadratic_polynomial,
        c_polynomial_a,
        nb_iterations,
        z_a,
        infinity=1.1 * escape_radius,
    )
    show_results('z^2+c', c_polynomial_a, escape_radius, z_final)

    _UpperCamelCase		:  Dict						=		1_2
    _UpperCamelCase		:  Tuple						=		1_0_0_0_0.0
    _UpperCamelCase		:  Union[str, Any]						=		iterate_function(
        eval_exponential,
        c_exponential,
        nb_iterations,
        z_a + 2,
        infinity=1.0e1_0,
    )
    show_results('e^z+c', c_exponential, escape_radius, z_final)










"""simple docstring"""



def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  str   ):





  '''simple docstring'''





  lowercase							   =	len(__snake_case   )
  lowercase							   =	[0] * length
  lowercase							   =	[[False for i in range(__snake_case   )] for j in range(__snake_case   )]
  for i, c in enumerate(__snake_case   ):
    lowercase							   =	i
    for j in range(i + 1   ):
      if c == string[j] and (i - j < 2 or is_palindromic[j + 1][i - 1]):
        lowercase							   =	True
        lowercase							   =	min(__snake_case		, 0 if j == 0 else (cut[j - 1] + 1)   )
    lowercase							   =	mincut
  return cut[length - 1]


if __name__ == "__main__":
    _UpperCamelCase		:  List[Any]						=		input('Enter the string: ').strip()
    _UpperCamelCase		:  List[Any]						=		find_minimum_partitions(s)
    print(F'''Minimum number of partitions required for the \'{s}\' is {ans}''')


