Solved first Project Euler problem