{-# LANGUAGE ScopedTypeVariables #-}
import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Data.Char
import Data.List

import Data.Array
import Data.Array.IO


-- space delimited integers
getVals::IO [Int]
getVals = unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine


main::IO()
main = do
    n:m:_ <- getVals
    (connection::IOArray Int [Int]) <- newArray (1,n) []
    forM_ [1..m] (\ _ -> do 
        a:b:_<-getVals
        ls_a <- readArray connection a 
        ls_b <- readArray connection b
        writeArray connection a  (b:ls_a)
        writeArray connection b  (a:ls_b))
    (groupIds::IOArray Int Int) <- newArray (1,n) (-1)
    let (marking::Int -> Int -> IO())  = (\ i -> \ g ->  do
        (flag::Int) <-readArray groupIds i
        when (flag == -1) $ do
            writeArray groupIds i g
            this_adj <- readArray connection i
            forM_ this_adj (\ j -> do marking j g))
    forM_ [1..n] (\ (i::Int) -> do marking i i)
    ids <- getElems groupIds 
    print $ (maximum.(map length).group.sort) ids
