#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > a;
vector<int> color;
int n, m;
long long ans = 0;
void brut(int v) {
  if (v == n) {
    set<pair<int, int> > q;
    vector<bool> find(n, false);
    for (int i = 0; i < n; ++i) {
      for (int j : a[i]) {
        if (j < i) continue;
        if (color[i] == -1 && color[j] == -1) continue;
        if (color[i] == -1 || color[j] == -1) continue;
        pair<int, int> temp = {color[i], color[j]};
        if (temp.second < temp.first) swap(temp.first, temp.second);
        if (q.find(temp) != q.end()) continue;
        find[i] = find[j] = true;
        q.insert(temp);
        break;
      }
    }
    for (int i = 0; i < n; ++i) {
      for (int j : a[i]) {
        if (j < i) continue;
        if (color[i] == -1 && color[j] == -1) continue;
        if (color[i] == -1 || color[j] == -1) continue;
        pair<int, int> temp = {color[i], color[j]};
        if (temp.second < temp.first) swap(temp.first, temp.second);
        if (q.find(temp) != q.end()) continue;
        find[i] = find[j] = true;
        q.insert(temp);
      }
    }
    for (int i = 0; i < n; ++i)
      if (color[i] != -1 && !find[i]) return;
    ans = max(ans, (long long)q.size());
    return;
  }
  for (int i = -1; i < 6; ++i) {
    color[v] = i;
    brut(v + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  a.resize(n);
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    --x;
    --y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  color.resize(n);
  brut(0);
  cout << ans << "\n";
}
