n = gets.to_i cnt = 0 (1..n).each do |i| if i % 5 == 0 cnt += 2 end if i % 3 == 0 cnt += 2 end end puts cnt