





'''simple docstring'''




lowercase__       : Tuple         =       '''Alexander Joslin'''

import operator as op

from .stack import Stack






def 			_lowerCAmelCase     (    __snake_case    :					str     )	->	int:
     __A		:					Any						=			{'*': op.mul, '/': op.truediv, '+': op.add, '-': op.sub}

     __A		:					Stack[int]						=			Stack()
     __A		:					Stack[str]						=			Stack()

     for i in equation:
          if i.isdigit():
               # RULE 1
               operand_stack.push(int(__snake_case     )     )
          elif i in operators:
               # RULE 2
               operator_stack.push(__snake_case     )
          elif i == ")":
               # RULE 4
               __A		:					List[str]						=			operator_stack.peek()
               operator_stack.pop()
               __A		:					int						=			operand_stack.peek()
               operand_stack.pop()
               __A		:					str						=			operand_stack.peek()
               operand_stack.pop()

               __A		:					int						=			operators[opr](__snake_case					,				__snake_case     )
               operand_stack.push(__snake_case     )

    # RULE 5
     return operand_stack.peek()


if __name__ == "__main__":
  lowercase__       : Tuple         =       '''(5 + ((4 * 2) * (2 + 3)))'''
  # answer = 45
  print(f"""{equation} = {dijkstras_two_stack_algorithm(equation)}""")






'''simple docstring'''




def 			_lowerCAmelCase     (    __snake_case    :					int     )	->	bool:
     return sum(i for i in range(1					,				number // 2 + 1     ) if number % i == 0     ) == number


if __name__ == "__main__":
  print('''Program to check whether a number is a Perfect number or not...''')
  lowercase__       : int         =       int(input('''Enter number: ''').strip())
  print(f"""{number} is {"" if perfect(number) else "not "}a Perfect Number.""")