const processData = (lines) => {
    const [n, m] = lines[0].split(' ').map( x => +x)
    let friendships = {}
    for (let i=0; i<m; i++) {
        const f = lines[i+1].split(' ').map(x => +x)
        if (!friendships[f[0]]) {
            friendships[f[0]] = {}
        }
        if (!friendships[f[1]]) {
            friendships[f[1]] = {}
        }
        friendships[f[0]][f[1]] = true
        friendships[f[1]][f[0]] = true
    }

    let maxCount = 1
    let visited = new Set()
    for (let p in friendships) {
        if (!visited.has(p)) {
            let count = 0
            let stack = [p]
            let cur = 0
            while (cur < stack.length) {
                count++
                let item = stack[cur]
                visited.add(item)
                cur++
                for (let p in friendships[item]) {
                    if (!visited.has(p)) {
                        visited.add(p)
                        stack.push(p)
                    }
                }
            }
            maxCount = Math.max(maxCount, count)
        }
    }

    console.log(maxCount)
}

let i = ''
process.stdin.on('data', c => i += c)
process.stdin.on('end', () => {
    const {EOL} = require('os')
    const lines = i.split(EOL) /*your input text, split by lines*/
    processData(lines)
})
