program example
	implicit none

	integer(8) :: N,wa=0,i
    
    read(*,*) N
    
    do i=1,N
    
    	if(mod(i,3)==0 .or. mod(i,5)==0) then
           goto 1
        else
        	wa=wa+i
            write(*,*) i
        end if      
    
    1 end do


    write(*,*) wa
end program example
