Spadework 2020. 2. 13. 09:33

* Solved 기준 브론즈3 단순 풀이

s = 0
for _ in range(int(input())):
	n = input(); s += int(n[:-1])**int(n[-1])
print(s)