def all_factors_of_3_and_5(max_int)
    $count = 0;
    (0..max_int).each do |i|
        if i % 3 == 0 or i % 5 == 0
            $count += i
        end
    end
    return $count
end
$highest_number = 999
$result = all_factors_of_3_and_5($highest_number)
puts "#$result"