import java.util.*;

public class Main {

    static int maxn = 100;
    static int bestCost = Integer.MAX_VALUE;
    static int[][] relations = new int[Main.maxn][Main.maxn];

    public static void mincut(int N) {
        Vector<Vector<Integer>> compressed_vertices = new Vector<Vector<Integer>>();
        for (int i = 0; i < N; i++) {
            compressed_vertices.add(new Vector<Integer>());
            compressed_vertices.get(i).add(i);
        }

        int[] weights;
        weights = new int[N];
        boolean[] exist;
        exist = new boolean[N];
        boolean[] in_A;
        in_A = new boolean[N];
        for (int i = 0; i < N; i++) {
            exist[i] = true;
        }
        for (int ph = 0; ph < N - 1; ++ph) {
            for (int i = 0; i < N; i++) {
                in_A[i] = false;
            }
            for (int i = 0; i < N; i++) {
                weights[i] = 0;
            }
            int prev = 0;
            for (int it = 0; it < N - ph; ++it) {
                int sel = -1;
                for (int i = 0; i < N; ++i) {

                    if ((exist[i] == true) && (in_A[i] == false) && (sel == -1 || weights[i] > weights[sel])) {
                        sel = i;
                    }
                }
                if (it == N - ph - 1) {
                    if (weights[sel] < bestCost) {
                        bestCost = weights[sel];
                    }

                    compressed_vertices.get(prev).addAll(compressed_vertices.get(sel));

                    for (int i = 0; i < N; ++i) {
                        relations[prev][i] = relations[i][prev] += relations[sel][i];
                    }
                    exist[sel] = false;
                } else {

                    in_A[sel] = true;
                    for (int i = 0; i < N; ++i) {
                        weights[i] += relations[sel][i];
                    }
                    prev = sel;
                }
            }
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        int M = in.nextInt();
        for (int i = 0; i < M; i++) {
            int U = in.nextInt() - 1;
            int V = in.nextInt() - 1;
            relations[U][V] = 1;
            relations[V][U] = 1;
        }
        mincut(N);
        System.out.print(bestCost);
    }

}