tatic class Graph{
private class Vertex{
HashMap<String , Integer> neighbour = new HashMap<>();
}
HashMap<String , Vertex> vertices ;
public Graph(){
vertices = new HashMap<>();
}
public void addVertex(String add) {
Vertex vtx = new Vertex();
vertices.put(add , vtx);
}
public void addEdge(String vname1 , String vname2 , int length) {
Vertex vtx1 = vertices.get(vname1);
Vertex vtx2 = vertices.get(vname2);
if(vtx1==null || vtx2==null || vtx1.neighbour.containsKey(vname2))
return;
vtx1.neighbour.put(vname2 , length);
vtx2.neighbour.put(vname1 , length);
}
static int ans;
public void beautiful(String parent , HashMap<String , Boolean> processed){
int pchild = vertices.get(parent).neighbour.size();
processed.put(parent , true);
ArrayList<String> keys = new ArrayList<>( vertices.get(parent).neighbour.keySet() ) ;
for(String key : keys){
if(vertices.get(key).neighbour.size()>pchild)
{
ans++;
}
}
for(String key : keys){
if(processed.get(key)!=null && processed.get(key)==false)
beautiful(key , processed);
}
}
}
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
Graph graph = new Graph();
int master=0;
for(int i=1 ; i<=m ; i++){
int x=sc.nextInt();
int y=sc.nextInt();
if(i==1)
master=x;
if(graph.vertices.get(x+"")==null)
graph.addVertex(x+"");
if(graph.vertices.get(y+"")==null)
graph.addVertex(y+"");
graph.addEdge(x+"" , y+"" , 0);
}
graph.beautiful(master+"" , new HashMap<String, Boolean>());
System.out.println(graph.ans);
}