final class UnionFindTree<Element: Hashable> {
    
    enum Parent {
        case element(Element)
        case root(groupSize: Int)
    }
    
    private var parents: [Element: Parent]
    
    init<Elements: Sequence>(elements: Elements) where Elements.Element == Element {
        self.parents = elements.reduce(into: [:], { parents, element in
            parents[element] = .root(groupSize: 1)
        })
    }
    
    func group(of element: Element) -> (representative: Element, size: Int) {
        let parentOfElement = parents[element]!
        switch parentOfElement {
        case .element(let parent):
            let (representative, groupSize) = group(of: parent)
            self.parents[element] = .element(representative)
            return (representative: representative, size: groupSize)
        case .root(let groupSize):
            return (representative: element, size: groupSize)
        }
    }
    
    func sameGroupContains(_ a: Element, and b: Element) -> Bool {
        group(of: a) == group(of: b)
    }
    
    func uniteGroups(of a: Element, and b: Element) {
        var smallerGroup = group(of: a)
        var biggerGroup = group(of: b)
        guard smallerGroup.representative != biggerGroup.representative else { return }
        if smallerGroup.size > biggerGroup.size {
            swap(&smallerGroup, &biggerGroup)
        }
        self.parents[biggerGroup.representative] = .root(groupSize: smallerGroup.size + biggerGroup.size)
        self.parents[smallerGroup.representative] = .element(biggerGroup.representative)
    }
}

func main(input1: String = readLine()!) {
    let integers = input1.split(separator: " ").map { Int($0)! }
    let n = integers[0]
    let m = integers[1]
    
    let tree = UnionFindTree(elements: 1...n)
    for _ in 1...m {
        let integers = readLine()!.split(separator: " ").map { Int($0)! }
        let a = integers[0]
        let b = integers[1]
        tree.uniteGroups(of: a, and: b)
    }
    var maxGroupSize = 0
    for someone in 1...n {
        let groupSize = tree.group(of: someone).size
        if maxGroupSize < groupSize {
            maxGroupSize = groupSize
        }
    }
    print(maxGroupSize)
}

main()