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