Ujan has a lot of useless stuff in his drawers, a considerable part of which are his math notebooks: it is time to sort them out. This time he found an old dusty graph theory notebook with a description of a graph.

It is an undirected weighted graph on n vertices. It is a complete graph: each pair of vertices is connected by an edge. The weight of each edge is either 0 or 1; exactly m edges have weight 1, and all others have weight 0.

Since Ujan doesn't really want to organize his notes, he decided to find the weight of the minimum spanning tree of the graph. (The weight of a spanning tree is the sum of all its edges.) Can you find the answer for Ujan so he stops procrastinating?

Input

The first line of the input contains two integers n and m (1 ≤ n ≤ 10^5, 0 ≤ m ≤ min((n(n-1))/(2),10^5)), the number of vertices and the number of edges of weight 1 in the graph. 

The i-th of the next m lines contains two integers a_i and b_i (1 ≤ a_i, b_i ≤ n, a_i ≠ b_i), the endpoints of the i-th edge of weight 1.

It is guaranteed that no edge appears twice in the input.

Output

Output a single integer, the weight of the minimum spanning tree of the graph.

Examples

Input


6 11
1 3
1 4
1 5
1 6
2 3
2 4
2 5
2 6
3 4
3 5
3 6


Output


2


Input


3 0


Output


0

Note

The graph from the first sample is shown below. Dashed edges have weight 0, other edges have weight 1. One of the minimum spanning trees is highlighted in orange and has total weight 2.

<image>

In the second sample, all edges have weight 0 so any spanning tree has total weight 0.

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader sc = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, sc, out);
        out.close();
    }

    static class Task {
    	public int[] pre;
    	
    	public int find(int x) {
    		int temp=x;
    		
    		while(temp!=pre[temp])
    			temp=pre[temp];
    		int i=x,j;
    		while(i!=temp) {
    			j=pre[i];
    			pre[i]=temp;
    			i=j;
    		}
    		return temp;
    	}
    	
    	public void join(int x,int y) {
    		int a=find(x);
    		int b=find(y);
    		if(a!=b)
    			pre[a]=b;
    	}
    	
    	public void buildGraph(int[][] G,int[] from,int[] to,int n,int m) {
    		int[] cnt=new int[n];
    		for(int i=0;i<m;i++) {
    			cnt[from[i]]++;
    			cnt[to[i]]++;
    		}
    		for(int i=0;i<n;i++)
    			G[i]=new int[cnt[i]];
    		for(int i=0;i<m;i++) {
    			G[from[i]][--cnt[from[i]]]=to[i];
    			G[to[i]][--cnt[to[i]]]=from[i];
    		}
    	}
    	
    	public void enumConnectedComponentFromComplementGraph(int[][] G) {
    		int minDegreeIndex=-1;
    		int temp=Integer.MAX_VALUE;
    		
    		for(int i=0;i<G.length;i++) {     //找出补图中度数最小的点
    			if(temp>G[i].length) {
    				temp=G[i].length;
    				minDegreeIndex=i;
    			}
    		}
    		Arrays.sort(G[minDegreeIndex]);
    		for(int i=0,j=0;i<G.length;i++) {
    			if(j<G[minDegreeIndex].length&&i==G[minDegreeIndex][j]) {
    				j++;
    			}
    			else
    				join(minDegreeIndex,i);
    		}
    		for(int v:G[minDegreeIndex]) {
    			Arrays.sort(G[v]);
    			for(int i=0,j=0;i<G.length;i++) {
    				if(j<G[v].length&&i==G[v][j])
    					j++;
    				else
    					join(v,i);
    			}
    		}
    	}
    	
        public void solve(int testNumber, InputReader sc, PrintWriter out) throws IOException {
        	int n=sc.nextInt();
        	int m=sc.nextInt();
        	int[] from=new int[m];
        	int[] to=new int[m];
        	pre=new int[n];
        	int[][] G=new int[n][];
        	for(int i=0;i<n;i++)
        		pre[i]=i;
        	
        	for(int i=0;i<m;i++) {
        		from[i]=sc.nextInt()-1;
        		to[i]=sc.nextInt()-1;
        	}
        	buildGraph(G,from,to,n,m);
        	enumConnectedComponentFromComplementGraph(G);
        	HashSet<Integer> set=new HashSet<Integer>();
        	for(int i=0;i<n;i++)
        		set.add(find(i));
        	out.println(set.size()-1);
        }
    }

    static class InputReader{
        StreamTokenizer tokenizer;
        public InputReader(InputStream stream){
            tokenizer=new StreamTokenizer(new BufferedReader(new InputStreamReader(stream)));
            tokenizer.ordinaryChars(33,126);
            tokenizer.wordChars(33,126);
        }
        public String next() throws IOException {
            tokenizer.nextToken();
            return tokenizer.sval;
        }
        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }
        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }
        public boolean hasNext() throws IOException {
            int res=tokenizer.nextToken();
            tokenizer.pushBack();
            return res!=tokenizer.TT_EOF;
        }
        
        public double nextDouble() throws NumberFormatException, IOException {
        	return Double.parseDouble(next());
        }
        
        public BigInteger nextBigInteger() throws IOException {
        	return new BigInteger(next());
        }
    }
}
