from math import *

class safe_eval:
	allowed = []
	
	@staticmethod
	def eval( command, **dict ):
		#print( dict )
		temp = command
		for a in safe_eval.allowed:
			temp = temp.replace( a, '' )
		if temp == '':
			return eval( command, globals(), dict )
		else:
			raise Exception( 'It\'s not allowed: ' + temp )

safe_eval.allowed = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '.',
				     '*', '+', '-', '/', '(', ')', '>', '<', '=',
				     'arc', 'sin', 'cos', 'ctg', 'tg', 'pow',
				     'i', ',', ' ']

i, command = input( 'Input command: ' ).split( ' ', 1 )
command.strip()
ans = safe_eval.eval( command, **{ 'i' : int( i ) } )
print( ans )