A teacher emailed her students the following task.
"Write a program that reads the expression X=number1pot1+number2pot2+⋯+numberNpotN and prints the value of X. Every number1 through numberN is an integer, and every pot1 through potN is a one-digit integer."
While the teacher downloaded the file to her computer, the text formatting was lost and the task turned into a plain sum of N integers.
X=P1+P2+⋯+PN
For example, once the formatting was gone, the original X=212+1253 became X=212+1253. Given the integers P1 through PN of the damaged expression, compute and print the value of X from the original task.
Here aN means a multiplied by itself N times, and a0=1.