      program FizzBuzz
      implicit none
      integer N,i,S,l
      read(*,*) N
      S=0
      do i =1, N
      if (mod(i,5)==0.or.mod(i,3)==0) then
            l=1
      else
            S=S+i
      end if
      end do
      write(*,*) S
      stop 
      end program FizzBuzz
