#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const int N = 1e6 + 10;
const int M = 5e3 + 10;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
const int mod2 = 998244353;
const int mod3 = 1e9 + 9;
const int hash1 = 131;
const int hash2 = 13331;
unsigned long long has[N];
unsigned long long p[N];
pair<int, int> edge[N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  int u, v;
  p[0] = 1;
  for (int i = 1; i <= n; i++) {
    p[i] = hash1 * p[i - 1];
  }
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    edge[i] = {u, v};
    has[u] += p[v];
    has[v] += p[u];
  }
  long long ans = 0;
  for (int i = 1; i <= m; i++) {
    u = edge[i].first, v = edge[i].second;
    if (has[u] + p[u] == has[v] + p[v]) {
      ans++;
    }
  }
  sort(has + 1, has + 1 + n);
  for (int i = 1; i <= n; i++) {
    int j;
    for (j = i; j + 1 <= n && has[i] == has[j + 1]; j++)
      ;
    ans += (long long)(j - i + 1) * (j - i) / 2;
    i = j;
  }
  cout << ans << endl;
  return 0;
}
