program sample
  implicit none

  integer :: s,n,i,j
  integer(16) :: b,c,d,e,m
  read(*,*) s

  m=10**9+7

  n=s/3
  e=0
  do i=1,n
     s=s-3
     d=1
     do j=1,i-1
        d=d*(s+i-j)/j
     enddo
     e=e+d
     e=mod(e,m)
  enddo

  write(*,*) e
  
  stop
end program sample