#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <sstream>
#include <cassert>
#include <list>
using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
typedef pair<int,int> PI;
typedef vector<int> vi;
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define F first
#define S second

int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

const int MAX=30;
int edge[MAX][MAX];
int ans;
bool dd[MAX];
int x,y;

int is(){
  rep(i,x){
    if(dd[i])continue;
    bool tok=false;
    rep(j,x){
      if(!edge[i][j])continue;
      if(dd[j]){
	tok=true;
	break;
      }
    }
    if(!tok)return false;
  }
  return true;
}

void dfs(int vis,int dm){
  if(dm>=ans)return;
  if(vis==x && is()){
    ans=min(ans,dm);
    return;
  }else if(vis==x)return;
  
  dd[vis]=0;
  dfs(vis+1,dm);
  dd[vis]=1;
  dfs(vis+1,dm+1);
}
    

int main(){
  while(cin>>x>>y,x|y){


    memset(edge,0,sizeof(edge));
    ans=x;
  
    rep(i,y){
      int to,from;
      cin>>to>>from;
      edge[to][from]=1;
      edge[from][to]=1;
    }

    dfs(0,0);
    cout<<ans<<endl;
  }
}