#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1e6 + 10, mod = 1e9 + 7, inf = 2e9, P = 3, M = 1e18 + 8;
long long pw[maxn];
vector<long long> adj[maxn], vec;
map<long long, long long> cnt;
long long h[maxn], ans;
pair<long long, long long> e[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  pw[0] = 1;
  for (int i = 1; i <= n; i++) {
    pw[i] = (pw[i - 1] * P) % M;
  }
  for (int i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    e[i] = make_pair(x, y);
    h[x] = (h[x] + pw[y]) % M;
    h[y] = (h[y] + pw[x]) % M;
  }
  for (int i = 1; i <= n; i++) cnt[h[i]]++;
  long long num;
  for (int i = 1; i <= n; i++) {
    num = cnt[h[i]];
    ans = (ans + (num - 1) * num / 2) % M;
    cnt[h[i]] = 0;
  }
  long long u, v;
  for (int i = 0; i < m; i++) {
    u = e[i].first;
    v = e[i].second;
    long long q1 = (h[u] - pw[v] + M) % M;
    long long q2 = (h[v] - pw[u] + M) % M;
    if (q1 == q2) ans++;
    ans %= M;
  }
  cout << ans << endl;
}
