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])
	}

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

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

// BiconnectedComponents is \u4e8c\u91cd\u8fba\u9023\u7d50\u6210\u5206\u5206\u89e3
// \u8fba(u, v)\u306ford[u]<low[v]\u306e\u3068\u304d\u6a4b\u3068\u306a\u308b
// \u8a08\u7b97\u91cf(V+E)
// \u4f7f\u3044\u65b9 newBiconnectedComponents() => addEdge() => build()
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: e.u, v: e.v})
			t[x] = append(t[x], y)
			t[y] = append(t[y], x)
		}
	}
	return vs
}

// Lowlink is
// https://twitter.com/fmhr__/status/919774660635406337
// \u9802\u70b9v\u304b\u3089DFS\u6728\u306e\u306f\u65b9\u5411\u306e\u8fba\u3092\uff10\u56de\u4ee5\u4e0a\u3001\u5f8c\u9000\u8fba\uff10\u968e\u4ee5\u4e0a\uff11\u56de\u4ee5\u4e0b\u3068\u304a\u3063\u3066\u884c\u3051\u308b\u9802\u70b9\u306eord\u306e\u6700\u5c0f\u5024
// \u9589\u8def\u306b\u542b\u307e\u308c\u308b\u30ce\u30fc\u30c9\u306f\u3059\u3079\u3066\u304a\u306a\u3058\u305d\u306e\u6700\u5c0f\u5024ord\u306b\u306a\u308b
// \u4f7f\u3044\u65b9: 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] {
			// \u9802\u70b9v\u3092\u307e\u3060\u8a2a\u308c\u3066\u3044\u306a\u3044
			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 {
			// \u8fbauv\u3092\u901a\u3063\u3066\u3044\u306a\u3044
			// \u3053\u306e\u3068\u304duv\u306f\u5f8c\u9000\u8fba
			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\u3068has\u306froot\u3067\u66f4\u65b0\u3055\u308c\u308b
	par  []int   // \u89aa
	size []int   // \u91cd\u307f
	link [][]int // \u30b0\u30eb\u30fc\u30d7
}

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