#include<bits/stdc++.h>
using namespace std;
int read()
{
	char ch;
	while((ch=getchar())<'0'||ch>'9');
	int res=ch-48;
	while((ch=getchar())>='0'&&ch<='9')
		res=(res<<3)+(res<<1)+ch-48;
	return res;
}
int n,m;
int head[500005],to[2000005],nxt[2000005],tot,x,y;
void add(int u,int v)
{
	to[++tot]=v;
	nxt[tot]=head[u];
	head[u]=tot;
}
int main()
{
	freopen("barrck.in","r",stdin);freopen("barrck.out","w",stdout);
	n=read(),m=read();
	cout<<n*n+n*m-m<<'\n';
	while(m--)
	{
		x=read(),y=read();
		add(x,y);add(y,x);
	}
	return 0;
}
