





def     lowerCamelCase__  (  UpperCamelCase__      :							Union[str, Any]    )      ->			int:



					'''simple docstring'''




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


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







"""simple docstring"""







def 	lowercase     (							A_    ,  A_			)-> list[tuple[int, int, int]]:
  '''simple docstring'''







  a		:						Union[str, Any] 				=     sorted(A_    ,  key=lambda A_			: edge[2]			)

  a		:						List[Any] 				=     list(range(A_			)			)

  def find_parent(A_			):
    if i != parent[i]:
      a		:						Dict 				=     find_parent(parent[i]			)
    return parent[i]

  a		:						Optional[Any] 				=     0
  a		:						Optional[int] 				=     []

  for edge in edges:
    a		:						List[str] 				=     find_parent(edge[0]			)
    a		:						int 				=     find_parent(edge[1]			)
    if parent_a != parent_b:
      minimum_spanning_tree_cost += edge[2]
      minimum_spanning_tree.append(A_			)
      a		:						Tuple 				=     parent_b

  return minimum_spanning_tree


if __name__ == "__main__":  # pragma: no cover
 __lowercase   ,				__lowercase          = list(map(int, input().strip().split()))
 __lowercase          = []

 for _ in range(num_edges):
  __lowercase   ,				__lowercase   ,				__lowercase          = (int(x) for x in input().strip().split())
  edges.append((nodea, nodea, cost))

 kruskal(num_nodes, edges)






