#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 10;
const long long BASE = 727;
const long long MOD = 1e9 + 9;
long long n, m;
long long power[N], v1[N], v2[N], ans;
map<long long, long long> cnt;
int32_t main() {
  scanf("%d%d", &n, &m);
  long long x, u;
  power[0] = 1;
  for (long long i = 1; i < N; ++i) {
    power[i] = power[i - 1] * (long long)BASE;
  }
  for (long long i = 0; i < m; ++i) {
    scanf("%d%d", &u, &x);
    v1[u] += power[x];
    v1[x] += power[u];
  }
  for (long long i = 1; i < n + 1; ++i) {
    v2[i] = v1[i];
    v2[i] += power[i];
  }
  for (long long i = 1; i < n + 1; ++i) {
    ans += cnt[v1[i]];
    ans += cnt[v2[i]];
    cnt[v1[i]]++;
    cnt[v2[i]]++;
  }
  cout << ans;
}
