x,a[32],r,F="%d%d",w;S(k,b,m){k-x?S(k+1,b,m),++m<r&&S(k+1,b|a[k],m):(r=b-w|m>r?r:m);}main(i,j,y){for(;scanf(F,&x,&y)*x;S(0,0,0),w=!printf("%d \n",r)){for(r=i=x;i--;)w|=a[i]=1<<i;for(;y--;a[i]|=1<<j,a[j]|=1<<i)scanf(F,&i,&j);}}