#include<bits/stdc++.h>
using namespace std;
int ans;int n,m;
inline void dfs(register int now,register int cnt,register int want,register int fa)
{
	if(want==cnt) return (void)(ans+=1<<(n-fa+1));
	if(now>n) return ;
	for(register int i=now+1;i<=n;i++)
	{
		dfs(i,cnt,want,now);dfs(i,cnt+1,want,now);
	}
}
signed main(void)
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	cin>>n>>m;
	for(register int i=1;i<=m;i++)
	{
		register int u,v;
		scanf("%d%d%d",&u,&v);
	}
	for(register int i=1;i<=n;i++)
	{
		dfs(1,0,i,0);
	}
	printf("%d",ans);
	return 0;
}