#include <bits/stdc++.h>
#define ll long long
#define rep(i,l,m) for(int i=l;i<=m;++i)
using namespace std;
inline void read(int &x)
{
	int f=1;
	char ch=getchar();
	if(ch<'0'||ch>'9')
	{
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')
	{
		x=(x<<3)+(x<<1)+ch-'0';
		ch=getchar();
	}
	x*=f;
	return ;
}
inline void write(int x)
{
	if(x<0)
	{
		putchar('-');
		x=-x;
	}
	if(x>9) write(x/10);
	putchar(x%10+'0');
}
const int mod=1e9+7;
const int N=5e5+5;
int n,m;
int a,b;
vector<int> v[N];
int main()
{
	freopen("barrack.in","r",stdin);
	freopen("barrack.out","w",stdout);
	read(n);read(m);
	rep(i,1,m)
	{
		cin>>a>>b;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	write(n*n*m+1);
	return 0;
}