func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

struct Person {
    let id: Int

    var friends: Set<Int> = Set()
}

func mainD() {
    let (N, M) = readTwoInts()
    let pairs = (0..<M).map { _ in readTwoInts() }

    // それぞれの直接の友達をセットアップ(片側だけ)
    var persons: [Person] = (1...N).map { Person(id: $0) }
    pairs.forEach { pair in
        persons[pair.a - 1].friends.insert(pair.b)
        persons[pair.b - 1].friends.insert(pair.a)
    }

    // グループ分け
    var groups: [Set<Int>] = []
    for person in persons {
        var needNewGroup = true

        for i in (0..<groups.count) {
            if !groups[i].intersection(person.friends).isEmpty {
                needNewGroup = false

                groups[i].insert(person.id)
                for id in person.friends {
                    groups[i].insert(id)
                }
                break
            }
        }

        if needNewGroup {
            var newGroup = Set(person.friends)
            newGroup.insert(person.id)
            groups.append(newGroup)
        }
    }

    // 最大人数の判定
    print(groups.map { $0.count }.max()!)
}
mainD()