#include <bits/stdc++.h>
using namespace std;
template <class T1>
void deb(T1 e1) {
  cout << e1 << endl;
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << endl;
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << endl;
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << endl;
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << endl;
}
int X[] = {0, 0, 1, 0, 0, -1};
int Y[] = {0, 1, 0, 0, -1, 0};
int Z[] = {1, 0, 0, -1, 0, 0};
struct node {
  long long x, y;
  node() {}
  node(long long x, long long y) : x(x), y(y) {}
  bool operator<(const node& p) const { return x < p.x; }
};
unsigned long long Hash[1000006];
unsigned long long cnt[1000006];
long long a[1000006], b[1000006];
int main() {
  long long i, j, k, l, x, y, z, t, m, n;
  Hash[0] = 1;
  for (i = 1; i <= 1000000; i++) Hash[i] = Hash[i - 1] * 233;
  cin >> n >> m;
  memset(cnt, 0, sizeof(cnt));
  for (i = 0; i < m; i++) {
    scanf("%lld %lld", &a[i], &b[i]);
    cnt[a[i]] += Hash[b[i]];
    cnt[b[i]] += Hash[a[i]];
  }
  long long ans = 0;
  for (i = 0; i < m; i++) {
    x = a[i];
    y = b[i];
    if (cnt[x] + Hash[x] == cnt[y] + Hash[y]) ans++;
  }
  map<unsigned long long, long long> mp;
  x = 0;
  for (i = 1; i <= n; i++) {
    mp[cnt[i]]++;
    ans += mp[cnt[i]] - 1;
  }
  deb(ans);
  return 0;
}
