#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<bitset>
#include<cmath>
#include<ctime>
#include<queue>
#include<map>
#include<set>

#define int long long
#define lowbit(x) (x&(-x))
#define mid ((l+r)>>1)
#define lc (x<<1)
#define rc (x<<1|1)
#define fan(x) (((x-1)^1)+1)
#define max Max
#define min Min
#define abs Abs

using namespace std;

inline int read()
{
	int ans=0,f=1;
	char c=getchar();
	while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=(ans<<1)+(ans<<3)+c-'0';c=getchar();}
	return ans*f;
}

inline void write(int x)
{
	if(x<0) putchar('-'),x=-x;
	if(x/10) write(x/10);
	putchar((char)(x%10)+'0');
}

template<typename T>inline T Abs(T a){return a>0?a:-a;};
template<typename T,typename TT>inline T Min(T a,TT b){return a>b?b:a;}
template<typename T,typename TT> inline T Max(T a,TT b){return a>b?a:b;}

const int N=1e6+5;
int n,a[N];

inline int merge(int l,int r);

signed main()
{
	n=(1<<read());
	for(int i=1;i<=n;++i)
		a[i]=read();
	merge(1,n);
	return 0;
}

inline int merge(int l,int r)
{
	if(l==r) return l;
	int x1=merge(l,mid);
	int x2=merge(mid+1,r);
	if(l==1&&r==n) printf("%lld\n",a[x1]<a[x2]?x1:x2);
	return a[x1]>a[x2]?x1:x2;
}
#include <bits/stdc++.h>
using namespace std;

int main(){
    int n, m;
    cin >> n >> m;

    vector<vector<bool>> a(n + 1, vector<bool>(n + 1, false));
    for(int i = 1; i <= m; ++i){
        int x, y;
        cin >> x >> y;
        a[x][y] = true;
        a[y][x] = true;
    }

    const int FULL_MASK = (1 << n) - 1;
    vector<bool> isComplete(FULL_MASK + 1, true);
    for(int mask = 0; mask <= FULL_MASK; ++mask){
        vector<int> nodes;
        for(int bit = 0; bit < n; ++bit){
            if((mask >> bit) & 1){
                nodes.push_back(bit + 1);
            }
        }
        for(int i = 0; i < (int)nodes.size(); ++i){
            for(int j = i + 1; j < (int)nodes.size(); ++j){
                if(!a[nodes[i]][nodes[j]]){
                    isComplete[mask] = false;
                    break;
                }
            }
        }
    }

    const int INF = n + 5;
    vector<int> minCC(FULL_MASK + 1, INF);
    for(int mask = 0; mask <= FULL_MASK; ++mask){
        if(isComplete[mask]){
            minCC[mask] = 1;
        }
    }

    for(int mask = 1; mask <= FULL_MASK; ++mask){
        for(int submask = mask; submask >= 1; submask = (submask - 1) & mask){
            minCC[mask] = min(minCC[submask] + minCC[submask ^ mask], minCC[mask]);
        }
    }

    cout << minCC[FULL_MASK];
    
    return 0;
}