Solve problem 35 using Lua.