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.util.*;
import java.math.*;

// **** B. 0-1 MST ****

public class B {
	static char [] in = new char [1000005];
	public static void main (String [] arg) throws Throwable {
		int n = nextInt();
		int m = nextInt();
		HS [] AL = new HS[n];
		for (int i = 0; i<n; ++i) AL[i] =new HS();
		for (int i = 0; i<m; ++i) {
			int a = nextInt()-1;
			int b = nextInt()-1;
			AL[a].add(b);
			AL[b].add(a);
		}
		//HS HS = new HS(n<<1);
		//for (int i = 0; i<n; ++i) HS.add(i);
		int comps = 0;
		int [] tmp = new int [n];
		//Queue<Integer> Q = new LinkedList<Integer>();
		int [] Q = new int [n];
		int qptr0 = 0;
		int qptr1 = 0;
		boolean [] vis = new boolean [n];
		int [] HS1 = new int [n];
		int h1ptr = n;
		for (int i = 0; i<n; ++i) HS1[i] = i;
		
		int first = 0;
		while (first < n) {
			comps++;
			Q[qptr1++] = first;
			while (qptr0 < qptr1) {
				int p = Q[qptr0++];
				vis[p] = true;
				int h2ptr = 0;
				//int tmpptr = 0;
				for (int j = (p==first)?1:0; j<h1ptr; ++j) {
					if (!AL[p].contains(HS1[j])) {
						Q[qptr1++] = HS1[j];
					} else {
						HS1[h2ptr++] = HS1[j];
					}
				}
				h1ptr = h2ptr;
				//for (int i = 0; i<tmpptr; ++i) HS.remove(tmp[i]);
			}
			first = (h1ptr > 0) ? HS1[0] : n;
			//System.err.println("Comp finished");
		}
		System.out.println(comps-1);
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	/************** HELPER CLASSES ***************/
    static class HS extends HashSet<Integer>{public HS(){super();}public HS(int a){super(a);}};
	//static class AL extends ArrayList<Integer>{public AL(){super();}public AL(int a){super (a);}};
	static class Pair implements Comparable<Pair> {
		int i,j;long L; public Pair(int xx, int yy, long LL){i=xx;j=yy;L=LL;} 
		public int compareTo(Pair p) { return (this.L < p.L) ? -1 : (this.L == p.L) ? this.i - p.i : 1;}
	}
	/************** FAST IO CODE FOLLOWS *****************/
	public static long nextLong() throws Throwable {
		long i = System.in.read();boolean neg = false;while (i < 33) i = System.in.read();if (i == 45) {neg=true;i=48;}i = i - 48;
		int j = System.in.read();while (j > 32) {i*=10;i+=j-48;j = System.in.read();}return (neg) ? -i : i;
	}
	public static int nextInt() throws Throwable {return (int)nextLong();}
	public static String next() throws Throwable {
		int i = 0; while (i < 33 && i != -1) i = System.in.read(); int cptr = 0; while (i >= 33) { in[cptr++] = (char)i; i = System.in.read();}
		return new String(in, 0,cptr);
	}
	/**** LIBRARIES ****/
	public static long gcdL(long a, long b) {while (b != 0) {long tmp = b;b = (a % b);a = tmp;}return a;}
	public static int gcd(int a, int b) {while (b != 0) {int tmp = b;b = (a % b);a = tmp;}return a;}
	public static int[] sieve(int LIM) {
		int i,count = 0;
		boolean [] b = new boolean [LIM];
		for (i = 2;i<LIM; ++i) if (!b[i]) {count++; for (int j = i<<1; j<LIM; j+=i) b[j] = true;}
		int [] primes = new int[count];
		for (i = 2,count=0;i<LIM;++i) if (!b[i]) primes[count++] = i;
		return primes;
	}
	public static int[] numPrimeFactors(int LIM) {
		int i,count = 0;
		int [] b = new int [LIM];
		for (i = 2;i<LIM; ++i) if (b[i] == 0) {count++; for (int j = i; j<LIM; j+=i) b[j]++;}
		return b;
	}
	public static StringBuilder stringFromArray(int [] a) {
		StringBuilder b = new StringBuilder(9*a.length);
		for (int i = 0; i<a.length; ++i) {
			if (i != 0) b = b.append(' ');
			b = b.append(a[i]);
		}
		return b;
	}
	public static long modPow (long a, long n, long MOD) { long S = 1; for (;n > 0; n>>=1, a=(a*a)%MOD) if ((n & 1) != 0) S = (a*S) % MOD; return S;}
}

/* Full Problem Text:
  
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?

 */