n = gets.to_i cnt = 0 for i in 1..n do if i%3==0 cnt+=2 end if i%5==0 cnt+=2 end end p cnt