import Foundation

class UnionFind {
  private(set) var parents: [Int]
  private var levels: [Int]
 
  init(_ n: Int) {
    self.parents = (0..<n).map { $0 }
    self.levels = .init(repeating: 0, count: n)
  }

  func root(_ x: Int) -> Int {
    if parents[x] == x {
      return x
    }
    parents[x] = root(parents[x])
    return parents[x]
  }

  func merge(_ x: Int, _ y: Int) {
    let rootX = root(x)
    let rootY = root(y)
    
    if rootX == rootY {
      return
    }
    if levels[rootX] == levels[rootY] {
      parents[rootY] = rootX
      levels[rootX] += 1
    } else if levels[rootX] < levels[rootY] {
      parents[rootX] = rootY
    } else {
      parents[rootY] = rootX
    }
  }
  
}


let inp = readLine()!.split(separator: " ").map { Int($0)! }

let n = inp[0]
let m = inp[1]

let union = UnionFind(n)
for _ in 0..<m {
  let inputs = readLine()!.split(separator: " ").map { Int($0)! - 1 }
  let a = inputs[0]
  let b = inputs[1]
  union.merge(a, b)
}

var counts: [Int] = .init(repeating: 0, count: n)
var maxValue = 1
for i in 0..<n {
  let index = union.root(i)
  counts[index] += 1
  maxValue = max(maxValue, counts[index])
}
print(maxValue)