#include <bits/stdc++.h>
using namespace std;
std::vector<std::vector<long long> > v(1000005);
std::vector<long long> p(1000005);
long long pr = 31;
long long hsh[1000005] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, m, a, b;
  cin >> n >> m;
  p[0] = 1;
  for (int i = 1; i <= n; i++) {
    p[i] = (p[i - 1] * pr) % 1000000000000007;
  }
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    a--;
    b--;
    v[a].push_back(b);
    v[b].push_back(a);
    hsh[b] = (hsh[b] + p[a]) % 1000000000000007;
    hsh[a] = (hsh[a] + p[b]) % 1000000000000007;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    for (auto x : v[i]) {
      if ((hsh[i] + p[i]) % 1000000000000007 ==
          (hsh[x] + p[x]) % 1000000000000007)
        ans++;
    }
  }
  ans = ans / 2;
  sort(hsh, hsh + n);
  long long j;
  for (int i = 0; i < n; i = j) {
    for (j = i; j < n && hsh[j] == hsh[i]; j++)
      ;
    ans += ((j - i) * (j - i - 1LL)) / 2;
  }
  cout << ans << endl;
  return 0;
}
