#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const unsigned long long base = 1e9 + 7;
vector<int> Adlist[maxn];
unsigned long long H[maxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N, M;
  cin >> N >> M;
  for (int i = 1; i <= M; i++) {
    int a, b;
    cin >> a >> b;
    Adlist[a].push_back(b);
    Adlist[b].push_back(a);
  }
  for (int i = 1; i <= N; i++) sort(Adlist[i].begin(), Adlist[i].end());
  for (int i = 1; i <= N; i++) {
    unsigned long long h = 0;
    int len = Adlist[i].size();
    for (int j = (0); j <= (len - 1); j += (1)) {
      h = h * base + (unsigned long long)Adlist[i][j];
    }
    H[i] = h;
  }
  sort(H + 1, H + N + 1);
  unsigned long long Sol = 0, k = 0;
  for (int i = (1); i <= (N); i += (0)) {
    k = 0;
    while (i < N && H[i] == H[i + 1]) {
      i++, k++;
    }
    Sol += k * (k + 1) / 2;
    i++;
  }
  for (int i = (1); i <= (N); i += (1)) {
    Adlist[i].push_back(i);
    sort(Adlist[i].begin(), Adlist[i].end());
  }
  for (int i = (1); i <= (N); i += (1)) {
    unsigned long long h = 0;
    int len = Adlist[i].size();
    for (int j = (0); j <= (len - 1); j += (1)) {
      h = h * base + (unsigned long long)Adlist[i][j];
    }
    H[i] = h;
  }
  sort(H + 1, H + N + 1);
  k = 0;
  for (int i = (1); i <= (N); i += (0)) {
    k = 0;
    while (i < N && H[i] == H[i + 1]) {
      i++;
      k++;
    }
    Sol += k * (k + 1) / 2;
    i++;
  }
  cout << Sol << "\n";
  return 0;
}
