#include <iostream>
using namespace std;
#include <bits/stdc++.h>
int main() {
// your code goes here
int n,m;
cin>>n>>m;
vector<int>b[n+5];
int i=1;
for(i=1;i<=m;i++)
{
int x,y;
cin>>x>>y;
b[x].push_back(y);
b[y].push_back(x);
}
int source = 1;
int used[n+5]={0};
int level[n+5]={-1};
queue<int>q;
q.push(source);
used[source]=1;
level[source]=0;
int ways[n+5]={0};
ways[1]=1;
while(!q.empty())
{
int removed;
removed=q.front();
q.pop();
for(auto x:b[removed])
{
if(used[x]==0)
{
q.push(x);
used[x]=1;
level[x]=level[removed]+1;
ways[x]=ways[removed];
}
else
{
if(level[x]==level[removed]+1)
{
ways[x]=ways[x]+ways[removed];
}
}
}
}
// i=1;
//while(i<=n)
// {
// cout<<"the no of ways to reach "<<i<<" to "<<"source node is "<<ways[i]<<" "<<endl;
// i++;
// }
cout<<ways[6];
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KCmludCBtYWluKCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJaW50IG4sbTsKCWNpbj4+bj4+bTsKCXZlY3RvcjxpbnQ+YltuKzVdOwoJaW50IGk9MTsKCWZvcihpPTE7aTw9bTtpKyspCgkgewoJIAlpbnQgeCx5OwoJIAljaW4+Png+Pnk7CgkgCWJbeF0ucHVzaF9iYWNrKHkpOwoJIAliW3ldLnB1c2hfYmFjayh4KTsKCSB9CgkgCgkgaW50IHNvdXJjZSA9IDE7CgkgaW50IHVzZWRbbis1XT17MH07CgkgaW50IGxldmVsW24rNV09ey0xfTsKCSBxdWV1ZTxpbnQ+cTsKCSBxLnB1c2goc291cmNlKTsKCSB1c2VkW3NvdXJjZV09MTsKCSBsZXZlbFtzb3VyY2VdPTA7CgkgaW50IHdheXNbbis1XT17MH07Cgkgd2F5c1sxXT0xOwoJIHdoaWxlKCFxLmVtcHR5KCkpCgkgIHsKCSAgCW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