100 10
87 73
15 71
14 33
1 4
20 80
65 67
36 36
25 4
22 21
7 97
 4 2
3 3
3 4
 5 4
3 3
4 4
5 5
1 2
 4 4
1 2
2 3
3 1
4 4
 4 3
1 1
2 3
3 4
 1000000 1
255765 255765
 4 3
1 2
2 3
4 4
 4 2
1 1
1 2
 3 3
1 1
2 2
3 3
 5 4
1 1
2 3
2 4
2 5
 4 5
1 4
3 4
1 2
2 3
2 4
 4 4
2 3
2 4
3 4
4 4
 10 9
8 10
3 10
2 8
9 3
4 8
1 10
7 9
5 4
7 3
 10 10
1 2
2 3
3 4
4 5
5 1
6 6
7 7
8 8
9 9
10 10
 5 5
1 4
3 4
1 2
2 3
2 4
 3 3
1 2
2 2
3 3
 5 3
1 1
2 2
3 3
 6 12
1 2
1 3
2 3
1 1
2 2
3 3
4 5
5 6
4 6
4 4
5 5
6 6
 4 4
1 2
2 3
1 3
4 4
 5 4
1 2
3 3
4 4
5 5
 7 13
6 7
2 7
3 7
4 3
5 2
1 4
7 7
3 1
5 5
3 3
1 5
2 6
6 6
 2 2
1 1
2 2
 5 5
1 1
2 2
3 3
4 4
5 5
 1 1
1 1
 7 3
1 1
3 3
6 6
 3 3
1 1
2 3
3 3

0 1 0 0 0 0 0 1 0 0 8 6 12 0 8 0 0 0 0 0 57 0 0 0 0 0
import java.util.*;

public class WeirdJourney {
	static ArrayList<edge>[] a;
	static long[] twoAway;
	static int n;
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		n=scan.nextInt();
		int m=scan.nextInt();
		a=new ArrayList[n];
		for(int i=0;i<n;i++) a[i]=new ArrayList<>();
		int[] deg=new int[n];
		boolean[] self=new boolean[n];
		twoAway=new long[n];
		for(int i=0;i<m;i++) {
			int u=scan.nextInt()-1, v=scan.nextInt()-1;
			if(u==v) self[u]=true;
			a[u].add(new edge(i,v));
			if(u!=v) a[v].add(new edge(i,u));
			deg[u]++;
			deg[v]++;
		}
		if(!cnct()) {
			System.out.println(0);
			return;
		}
		for(int i=0;i<n;i++) {
			if(deg[i]==1||self[i]) go(i,new boolean[m],0);
//			System.out.println(Arrays.toString(twoAway));
		}
		long res=0L;
		for(int i=0;i<n;i++) {
			res+=twoAway[i];
		}
//		System.out.println(res);
		System.out.println(res/2);
	}
	public static void go(int at, boolean[] v, int dist) {
//		System.out.println(at+" "+dist);
		if(dist==2) {
			twoAway[at]++;
			return;
		}
		for(edge nxt:a[at]) {
//			System.out.println("considering edge "+nxt);
			if(!v[nxt.id]) {
//				System.out.println("and go;)");
				v[nxt.id]=true;
				go(nxt.v,v,dist+1);
				v[nxt.id]=false;
			}
		}
	}
	static class edge {
		int id,v;
		edge(int id, int v) {
			this.id=id;
			this.v=v;
		}
		public String toString() {
			return id+" "+v;
		}
	}
	public static boolean cnct() {
		ArrayDeque<Integer> q=new ArrayDeque<>();
		boolean[] v=new boolean[n];
		v[0]=true;
		int ct=1;
		q.offer(0);
		while(!q.isEmpty()) {
			int at=q.poll();
			for(edge nxt:a[at]) {
				if(v[nxt.v]) continue;
				q.offer(nxt.v);
				v[nxt.v]=true;
				ct++;
			}
		}
		return ct==n;
	}
}