program answer
  implicit none
  integer(8) :: i, N, M, count, h
  integer(8), allocatable :: A(:), B(:), C(:), D(:)
  read(*,*) N, M
  allocate(A(M),B(M),C(N),D(N))
  do i = 1, M
     read(*,*) A(i), B(i)
  end do

  do i = 1, M
     if(B(i)<A(i)) then
        h=B(i)
        B(i)=A(i)
        A(i)=h
     end if
  end do

  call heapsort(M,A,B)

  D=0
  C=0
  do i = 1, M
     if(D(B(i))==1) then
        cycle
     end if
     D(B(i))=1
     C(A(i))=C(A(i))+1
  end do

  write(*,*) maxval(C)+1
  deallocate(A,B,C,D)
  stop
contains
  subroutine heapsort(n,array1,array2)
  implicit none
  integer(8),intent(in) :: n
  integer(8),intent(inout) :: array1(1:n), array2(1:n)
  integer(8) ::i,k,j,l
  integer(8) :: t, tt
 
  l=n/2+1
  k=n
  do while(k.ne.1)
     if(l.gt.1)then
        l=l-1
        t=array1(L)
        tt=array2(L)
     else
        t=array1(k)
        tt=array2(k)
        array1(k)=array1(1)
        array2(k)=array2(1)
        k=k-1
        if(k.eq.1) then
           array1(1)=t
           array2(1)=tt
           exit
        end if
     end if
     i=l
     j=l+l
     do while(j.le.k)
        if(j.lt.k) then
           if(array1(j).lt.array1(j+1)) then
              j=j+1
           end if
        end if
        if (t.lt.array1(j)) then
           array1(i)=array1(j)
           array2(i)=array2(j)
           i=j
           j=j+1
        else
           j=k+1
        end if
     end do
     array1(i)=t
     array2(i)=tt
  end do

  return
end subroutine heapsort
 end program answer
