program answer
  implicit none

  integer ::a, N

  read(*,*) N

  if (1<N.and.N<105) then
     a = 0
  else if(105<=N.and.N<135) then
     a = 1
  else if(135<=N.and.N<165) then
     a = 2
  else if(165<=N.and.N<189) then
     a = 3
  else if(189<=N.and.N<195) then
     a = 4
  else if(195<=N.and.N<=200) then
     a = 5
  end if

  write(*,*) a
  stop
 end program answer
