local N = io.read("*n") local ans = {} for i=0, 18 do ans[i] = 0 end function read() local c = ' ' while true do c = io.read(1) if c > ' ' then break end end local s = "" .. c while true do c = io.read(1) if c <= ' ' then break end s = s .. c end return s end local ans = {} for i = 1, 20 do ans[i] = 0 end for i=1,N do s = string.reverse(read()) for j=1, #s do ans[j] = ans[j] + tonumber(string.sub(s, j, j)) end end for i = 1, 19 do ans[i + 1] = ans[i + 1] + math.floor(ans[i] / 10) ans[i] = ans[i] % 10 end local i = 20 while i >= 1 and ans[i] == 0 do i = i - 1 end if i == 0 then print(0) else for i = i, 1, -1 do io.write(string.format("%01d", ans[i])) end io.write("\n") end