Задача Codewars Total amount of points

Решаем задачу Codewars - общее количество очков.