package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)

// const abcd = "abcdefghijklnmopqrstuvwxyz"
// const ABCD = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

// var dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1}
// var dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1}

// var dx = [...]int{0, 1, 0, -1}
// var dy = [...]int{1, 0, -1, 0}

///////////////////////////////////////////////////

func main() {
	log.SetFlags(log.Lshortfile)
	next := newScanner()
	N := next.Int()
	M := next.Int()
	a := make([]int, M)
	b := make([]int, M)
	for i := 0; i < M; i++ {
		a[i] = next.Int() - 1
		b[i] = next.Int() - 1
	}

	bc := newBiconnectedComponents(N)
	for i := 0; i < M; i++ {
		bc.addEdge(a[i], b[i])
		// bc.addEdge(b[i], a[i])
	}

	r := bc.build()
	fmt.Println(len(r))
	log.Println(r)
}

///////////////////////////////////////////////////

// BiconnectedComponents is 二重辺連結成分分解
// 辺(u, v)はord[u]<low[v]のとき橋となる
// 計算量(V+E)
type BiconnectedComponents struct {
	ll    *Lowlink
	edges []Edge
	comp  []int
}

// Edge is ...
type Edge struct {
	u, v int
}

func newBiconnectedComponents(numNode int) *BiconnectedComponents {
	bc := &BiconnectedComponents{}
	bc.ll = newLowLink(numNode)
	bc.comp = make([]int, numNode)
	return bc
}

func (bc *BiconnectedComponents) addEdge(u, v int) {
	bc.ll.add(u, v)
	bc.edges = append(bc.edges, Edge{u: u, v: v})
}

func (bc *BiconnectedComponents) build() []Edge {
	bc.ll.calc()
	ptr := 0
	cc := make([]int, len(bc.ll.g))
	for i := 0; i < len(bc.ll.g); i++ {
		if i == bc.ll.uf.Find(i) {
			cc[i] = ptr
			ptr++
		}
	}
	t := make([][]int, ptr)
	for i := 0; i < len(bc.ll.g); i++ {
		bc.comp[i] = cc[bc.ll.uf.Find(i)]
	}
	vs := make([]Edge, 0)
	for _, e := range bc.edges {
		x := bc.comp[e.u]
		y := bc.comp[e.v]
		if x != y {
			vs = append(vs, Edge{u: x, v: y})
			t[x] = append(t[x], y)
			t[y] = append(t[y], x)
		}
	}
	return vs
}

// Lowlink is
// https://twitter.com/fmhr__/status/919774660635406337
// 頂点vからDFS木のは方向の辺を０回以上、後退辺０階以上１回以下とおって行ける頂点のordの最小値
// 閉路に含まれるノードはすべておなじその最小値ordになる
// 使い方: newLowLink => add() => calc()
type Lowlink struct {
	uf     *UnionFind
	g      [][]int
	used   []bool
	ord    []int
	low    []int
	parent []int
}

func newLowLink(numNodes int) *Lowlink {
	ll := &Lowlink{}
	ll.uf = makeUnionFind(numNodes)
	ll.g = make([][]int, numNodes)
	ll.used = make([]bool, numNodes)
	ll.ord = make([]int, numNodes)
	ll.low = make([]int, numNodes)
	ll.parent = make([]int, numNodes)
	for i := 0; i < numNodes; i++ {
		ll.parent[i] = -1
	}
	return ll
}

func (ll *Lowlink) add(u, v int) {
	ll.g[u] = append(ll.g[u], v)
	ll.g[v] = append(ll.g[v], u)
}

func (ll *Lowlink) dfs(idx int, k *int, par int) {
	ll.used[idx] = true
	ll.ord[idx] = *k
	ll.low[idx] = ll.ord[idx]
	*k++
	// u -> v
	for _, to := range ll.g[idx] {
		if !ll.used[to] {
			// 頂点vをまだ訪れていない
			ll.dfs(to, k, idx)
			ll.low[idx] = min(ll.low[idx], ll.low[to])
			ll.parent[to] = idx
			if ll.ord[idx] >= ll.low[to] {
				ll.uf.Unit(idx, to)
			}
		} else if to != par {
			// 辺uvを通っていない
			// このときuvは後退辺
			ll.low[idx] = min(ll.low[idx], ll.ord[to])
		}
	}
}

func (ll *Lowlink) calc() {
	var k int
	ll.dfs(0, &k, -1)
}

// UnionFind is ...
type UnionFind struct {
	// sizeとhasはrootで更新される
	par  []int   // 親
	size []int   // 重み
	link [][]int // グループ
}

func makeUnionFind(count int) *UnionFind {
	par := make([]int, count)
	size := make([]int, count)
	link := make([][]int, count)
	for i := 0; i < count; i++ {
		link[i] = make([]int, 1)
	}
	for i := 0; i < count; i++ {
		par[i] = i
		size[i] = 1
		link[i][0] = i
	}
	return &UnionFind{par: par, size: size, link: link}
}

// Find is ...
func (uf *UnionFind) Find(a int) int {
	for uf.par[a] != a {
		uf.par[a] = uf.par[uf.par[a]]
		a = uf.par[a]
	}
	return a
}

// Unit is ...
func (uf *UnionFind) Unit(a, b int) {
	a = uf.Find(a)
	b = uf.Find(b)
	if a != b {
		if uf.size[a] > uf.size[b] {
			a, b = b, a
		}
		uf.par[a] = b
		uf.size[b] += uf.size[a]
		uf.link[b] = append(uf.link[b], uf.link[a]...)
	}
}

// Same is ...
func (uf *UnionFind) Same(a, b int) bool {
	return uf.Find(a) == uf.Find(b)
}

// Weight is ...
func (uf UnionFind) Weight(a int) int {
	return uf.size[uf.Find(a)]
}
func in(c, a, z int) bool {
	return c >= a && c < z
}

func btoi(b bool) int {
	if b {
		return 1
	}
	return 0
}

func itob(a int) bool {
	if a == 0 {
		return false
	}
	return true
}

func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}

func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}

func minmax(a, b int) (int, int) {
	if a < b {
		return a, b
	}
	return b, a
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func newScanner() *scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 10000)
	return &scanner{r: rdr}
}
func (s *scanner) next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *scanner) Line() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *scanner) Int() int {
	v, _ := strconv.Atoi(s.next())
	return v
}
func (s *scanner) Int64() int64 {
	v, _ := strconv.ParseInt(s.next(), 10, 64)
	return v
}
func (s *scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 640