program sample
    implicit none
    character(100)::s,t
    integer(8) :: i,j,k,m,n,ans
    integer(8)::a,b,c,d
    integer(8),allocatable::x(:),y(:)
  
    read(*,*)k
    do i=1,k/2+1
        m=m+i
        if(m>=k)then
            
            ans=i
            
            write(*,*)ans
            stop
        end if
    end do       
    
    stop
end program sample
  

