const merge = (f1, f2) => {
    if (f1 && f2) {
        const s = new Set()
        for (const t of f1) {
            s.add(t)
        }
        for (const t of f2) {
            s.add(t)
        }
        return s
    }
    return f1 || f2 || (new Set())
}


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

    let maxCount = 1
    for (let p in friendships) {
        maxCount = Math.max(maxCount, friendships[p].size)
    }

    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)
})
