k = 0 gets.chomp.to_i.times do |i| k +=2 if i+1 % 3 == 0 k +=2 if i+1 % 5 == 0 end p k