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 javafx.scene.layout.Priority;
import sun.reflect.generics.tree.Tree;

import java.sql.Array;
import java.util.*;
import java.io.*;
import java.util.stream.Stream;

import static java.lang.Math.*;
public class D
{
    static InputReader in=new InputReader(System.in);
    static OutputWriter out=new OutputWriter(System.out);
    static StringBuilder sb=new StringBuilder();
    static long MOD = (long)(998244353);

    static TreeSet<Integer>[] graph;
    static TreeSet<Integer> vertices;
    static boolean visited[];
    static int n;
    static int m;
    static int size;

    public static void dfs(int i){
        ArrayList<Integer> list = new ArrayList<>();
        Iterator<Integer> itr = vertices.iterator();
        while(itr.hasNext()){
            int j = itr.next();
            if(!graph[i].contains(j)){
                list.add(j);
                itr.remove();
            }
        }

        for(int x: list) dfs(x);
    }


    // Main Class Starts Here
    public static void main(String args[])throws IOException
    {
        // Write your code.
        int t = 1;
        while(t-->0) {
            n = in();
            m = in();

            graph = new TreeSet[n];
            vertices = new TreeSet<Integer>();
            for(int i = 0; i < n ;i++){
                graph[i] = new TreeSet<Integer>();
                vertices.add(i);
            }

            for(int i = 0; i < m; i++){
                int u = in();
                int v = in();
                u--;
                v--;
                graph[u].add(v);
                graph[v].add(u);
            }

            int ans = 0;
            for(int i = 0; i < n; i++){
                if(vertices.remove(i)){
                    ans++;
                    dfs(i);
                }
            }
            app(ans-1);
        }
        out.printLine(sb);
        out.close();
    }

    static class DisjointSet{
        int par[];
        int rank[];
        int n;
        public DisjointSet(int n){
            this.n = n;
            par = new int[n];
            rank = new int[n];
            for(int i = 0; i < n; i++){
                par[i] = i;
            }
        }

        public int findPar(int i){
            // path compression.
            if(par[i] != i){
                par[i] = findPar(par[i]);
            }
            return par[i];
        }

        public int merge(int x, int y){
            int parX = findPar(x);
            int parY = findPar(y);
            if(parX == parY) return 0; // no decrease in connected components
            if(rank[parX] > rank[parY]){
                // merge y to x.
                par[parY] = parX;
            }
            else if(rank[parY] > rank[parX]){
                par[parX] = parY;
            }
            else{
                par[parY] = parX;
                rank[parX]++;
            }
            return 1; // after merging the decrease in connected components is 1.
        }
    }

    public static class Edge{
        int from;
        int to;
        int id;
        boolean visited;
        public Edge(int from, int to, int id){
            this.from = from;
            this.to = to;
            this.id =id;
            this.visited = false;
        }
    }

    public static int[] an(int n) {
        int ar[]=new int[n];
        for(int i=0;i<n;i++)
            ar[i]=in();
        return ar;
    }

    public static long[] lan(int n) {
        long ar[]=new long[n];
        for(int i=0;i<n;i++)
            ar[i]=lin();
        return ar;
    }

    public static String atos(Object ar[]) {
        return Arrays.toString(ar);
    }

    public static int in() {
        return in.readInt();
    }

    public static long lin() {
        return in.readLong();
    }

    public static String sn() {
        return in.readString();
    }

    public static void prln(Object o) {
        out.printLine(o);
    }

    public static void prn(Object o) {
        out.print(o);
    }

    public static void display(int a[]) {
        out.printLine(Arrays.toString(a));
    }

    public static HashMap<Integer,Integer> hm(int a[]){
        HashMap<Integer,Integer> map=new HashMap<>();
        for(int i=0; i < a.length;i++) {
            int keep = (int)map.getOrDefault(a[i],0);
            map.put(a[i],++keep);
        }
        return map;
    }

    public static void app(Object o) {
        sb.append(o);
    }

    public static long calcManhattanDist(int x1,int y1,int x2,int y2) {
        long xa = Math.abs(x1-x2);
        long ya = Math.abs(y1-y2);
        return (xa+ya);
    }


    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object...objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object...objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }
    }
}