#include <bits/stdc++.h>
using namespace ::std;
const long long maxn = 1e6 + 6100;
long long tav[maxn][2];
long long hashba[maxn][2];
long long hashbi[maxn][2];
long long base[2];
long long mod[2];
map<pair<long long, long long>, long long> ml;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  mod[0] = 1e9 + 7;
  mod[1] = 1e9 + 9;
  base[0] = 737;
  base[1] = 373;
  tav[0][0] = 1;
  tav[0][1] = 1;
  for (long long i = 1; i < maxn; i++) {
    tav[i][0] = (tav[i - 1][0] * base[0]) % mod[0];
    tav[i][1] = (tav[i - 1][1] * base[1]) % mod[1];
  }
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    hashba[i][0] = tav[i][0];
    hashba[i][1] = tav[i][1];
  }
  for (long long i = 0; i < m; i++) {
    long long v, u;
    cin >> v >> u;
    hashba[v][0] = (hashba[v][0] + tav[u][0]) % mod[0];
    hashba[u][0] = (hashba[u][0] + tav[v][0]) % mod[0];
    hashba[v][1] = (hashba[v][1] + tav[u][1]) % mod[1];
    hashba[u][1] = (hashba[u][1] + tav[v][1]) % mod[1];
    hashbi[v][0] = (hashbi[v][0] + tav[u][0]) % mod[0];
    hashbi[u][0] = (hashbi[u][0] + tav[v][0]) % mod[0];
    hashbi[v][1] = (hashbi[v][1] + tav[u][1]) % mod[1];
    hashbi[u][1] = (hashbi[u][1] + tav[v][1]) % mod[1];
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans += ml[make_pair(hashba[i][0], hashba[i][1])];
    ans += ml[make_pair(hashbi[i][0], hashbi[i][1])];
    ml[make_pair(hashba[i][0], hashba[i][1])]++;
    ml[make_pair(hashbi[i][0], hashbi[i][1])]++;
  }
  cout << ans;
}
