#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 2;
long long t, n, m;
set<long long> g[8];
int32_t main() {
  cin >> n >> m;
  if (n < 7) return cout << m << endl, 0;
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].insert(v);
    g[v].insert(u);
  }
  long long mn = 100;
  for (long long i = 1; i < 8; i++) {
    for (long long j = 1; j < 8; j++) {
      long long tmp = 0;
      for (long long k = 1; k < 8; k++)
        if (g[i].count(k) && g[j].count(k)) tmp++;
      mn = min(tmp, mn);
    }
  }
  cout << m - mn << endl;
}
