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
#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
const int M = 1000000007;
const double PI = atan(1) * 4;
const int oo = 1000000000;
int n, m, low[10 * N], disc[10 * N], T, P[10 * N], sz[10 * N];
vector<vector<int> > v;
bool vis[10 * N];
set<pair<int, int> > st;
inline bool bridge(int a, int b) {
  if (st.find(pair<int, int>(min(a, b), max(a, b))) != st.end()) return true;
  return false;
}
long long ans;
int lp[10 * N];
void dfs(int u) {
  vis[u] = true;
  for (int i = 0; i < v[u].size(); ++i) {
    int d = v[u][i];
    for (int j = 0; j < v[d].size(); ++j) {
      int k = v[d][j];
      if (min(u, d) == min(d, k) && max(u, d) == max(d, k)) continue;
      bool f = 1;
      if (v[u].size() > 1 + lp[u] && v[d].size() > 1 + lp[d] && bridge(u, d))
        f = 0;
      if (f && v[d].size() > 1 + lp[d] && v[k].size() > 1 + lp[k] &&
          bridge(d, k))
        f = 0;
      ++ans;
    }
    if (!vis[d]) dfs(d);
  }
}
int build(int u, int p) {
  P[u] = p;
  vis[u] = 1;
  int x = 1;
  for (int i = 0; i < v[u].size(); ++i)
    if (!vis[v[u][i]] &&
        st.find(pair<int, int>(min(u, v[u][i]), max(u, v[u][i]))) == st.end())
      x += build(v[u][i], p);
  return x;
}
void br(int u, int p) {
  vis[u] = true;
  low[u] = disc[u] = T++;
  for (int i = 0; i < v[u].size(); ++i) {
    if (!vis[v[u][i]]) {
      br(v[u][i], u);
      if (low[v[u][i]] > disc[u])
        st.insert(pair<int, int>(min(u, v[u][i]), max(u, v[u][i])));
      low[u] = min(low[u], low[v[u][i]]);
    } else if (v[u][i] != p)
      low[u] = min(low[u], disc[v[u][i]]);
  }
}
void ckk(int);
int main() {
  cin >> n >> m;
  v.resize(n);
  if (m < 2) return cout << 0, 0;
  for (int a, b, i = 0; i < m; ++i) {
    scanf("%d%d", &a, &b);
    --a;
    --b;
    v[a].push_back(b);
    if (a != b)
      v[b].push_back(a);
    else
      lp[a] = 1;
  }
  ckk(0);
  for (int i = 0; i < n; ++i)
    if (!vis[i]) return cout << 0, 0;
  memset(vis, 0, sizeof(vis));
  br(0, -1);
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; ++i)
    if (!vis[i]) sz[i] = build(i, i);
  memset(vis, 0, sizeof(vis));
  dfs(0);
  cout << ans / 2 << endl;
}
void ckk(int u) {
  vis[u] = true;
  for (int i = 0; i < v[u].size(); ++i)
    if (!vis[v[u][i]]) ckk(v[u][i]);
}
