#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, a, b;
  int A = 1e9 + 7, B = 972663749;
  cin >> n >> m;
  vector<long long> hash(n, 1), hash2(n, 1);
  vector<bool> appears(n);
  vector<int> unique_value(n), unique_value2(n);
  for (int i = 0; i < n; i++) unique_value[i] = i + 3;
  for (int i = 0; i < n; i++) unique_value2[i] = 2 * i + 4;
  random_shuffle(unique_value2.begin(), unique_value2.end());
  random_shuffle(unique_value.begin(), unique_value.end());
  vector<pair<int, int>> queries;
  vector<bool> friends_with_self(n);
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    a--;
    b--;
    hash[a] *= unique_value[b];
    hash[a] %= A;
    hash[b] *= unique_value[a];
    hash[b] %= A;
    hash2[a] *= unique_value2[b];
    hash2[a] %= B;
    hash2[b] *= unique_value2[a];
    hash2[b] %= B;
    queries.push_back({a, b});
    appears[a] = true;
    appears[b] = true;
  }
  for (int i = 0; i < m; i++) {
    a = queries[i].first, b = queries[i].second;
    if (((hash[a] * unique_value[a]) % A == (hash[b] * unique_value[b]) % A) &&
        ((hash2[a] * unique_value2[a]) % B ==
         (hash2[b] * unique_value2[b]) % B)) {
      friends_with_self[a] = true;
      friends_with_self[b] = true;
    }
  }
  map<pair<int, int>, int> mm;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (appears[i] == false)
      ans++;
    else if (friends_with_self[i])
      mm[{(hash[i] * unique_value[i]) % A,
          (hash2[i] * unique_value2[i]) % B}] += 1;
    else
      mm[{hash[i], hash2[i]}] += 1;
  }
  ans = (ans * (ans - 1)) / 2;
  for (auto e : mm) {
    ans += (e.second) * (e.second - 1) / 2;
  }
  cout << ans << '\n';
}
