#include <bits/stdc++.h>
using namespace std;
map<pair<long long, long long>, long long> m3, m1;
map<long long, long long> m2;
int main() {
  long long n, m, i, j, k, l, x, y, c, z;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    if (x < y)
      m3[{x, y}] = 1;
    else
      m3[{y, x}] = 1;
  }
  if (n <= 6) {
    cout << m;
    return 0;
  }
  long long m_ = INT_MIN;
  for (i = 1; i <= 6; i++) {
    for (j = i + 1; j <= 7; j++) {
      m1.clear();
      for (k = 1; k <= 6; k++)
        for (l = k; l <= 6; l++) m1[{k, l}] = 1;
      c = 2;
      z = 0;
      m2[i] = 1;
      m2[j] = 1;
      for (k = 1; k <= 7; k++)
        if (k != i && k != j) m2[k] = c, c++;
      for (auto x : m3)
        if (m1[{m2[x.first.first], m2[x.first.second]}] == 1)
          m1[{m2[x.first.first], m2[x.first.second]}] = 0, z++;
        else if (m1[{m2[x.first.second], m2[x.first.first]}] == 1)
          m1[{m2[x.first.second], m2[x.first.first]}] = 0, z++;
      m_ = max(m_, z);
    }
  }
  cout << m_;
  return 0;
}
