'use strict'

function warshall_floyd(N, graph){
  for(let i=0;i<N;i++){
    for(let j=0;j<N;j++){
      for(let k=0;k<N;k++){
        graph[i][j] = graph[i][j] = Math.min(graph[i][j], graph[i][k] + graph[k][j]);
      }
    }
  }
}

function main(input){
  const lines = input.split('\n');
  const NM  =lines.shift().split(' ').map(x => parseInt(x));
  const N = NM[0];
  const M = NM[1];
  const sides = [];
  const graph = [];
  for(let i=0;i<N;i++){
    graph.push( Array(N).fill(9) );
    graph[i][i]=0;
  }

  for(let i=0;i<M;i++){
    let current = lines.shift().split(' ').map( x=>parseInt(x) );
    graph[current[1]-1][current[0]-1]=graph[current[0]-1][current[1]-1]=0;
    sides.push(current);
  }

  let result=0;
  for(let i=0;i<M;i++){
    let copied_graph = [];
    for(let j=0;j<N;j++){
      copied_graph.push( Array.from(graph[j]) );
    }

    let current = sides[i];
    copied_graph[current[1]-1][current[0]-1]=copied_graph[current[0]-1][current[1]-1]=9;

    warshall_floyd(N, copied_graph);

//console.log(current);
//console.log(copied_graph[current[1]-1][current[0]-1]);
//console.log(copied_graph);
//console.log('---');

    if(copied_graph[current[1]-1][current[0]-1]==9){result++;}
  }

  console.log(result);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
