class Solution:
def evalRPN(self, tokens: List[str]) -> int:
s = []
res = 0
if len(tokens)==1:
return int(tokens[0])
for i in range(len(tokens)):
if tokens[i] == "+":
res = s.pop() + s.pop()
s.append(res)
elif tokens[i] == "-":
s3=s.pop()
res =s.pop()-s3
s.append(res)
elif tokens[i] == "*":
res = s.pop() * s.pop()
s.append(res)
elif tokens[i] == "/":
s1=s.pop()
res =int(s.pop()/s1)
s.append(res)
else:
s.append(int(tokens[i]))
return res