let nm = readLine()!.split(separator: " ").map{Int($0)!}
let (n, m) = (nm[0], nm[1])
var friendPair = [Set<Int>]()
for _ in 0..<m {
    friendPair.append(Set(readLine()!.split(separator: " ").map{Int($0)!}))
}

var index = 0
while index < friendPair.count {
    for i in index+1..<friendPair.count {
        if friendPair[index].isDisjoint(with: friendPair[i]) {
            continue
        } else {
            friendPair[i] = friendPair[i].union(friendPair[index])
            friendPair.remove(at: index)
            index -= 1
            break
        }

    }
    index += 1
}
print(friendPair.map{$0.count}.max()!)
