#include <bits/stdc++.h>
using namespace std;
long long a[8][8], n, m, u, v, k = INT_MAX;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    cin >> u >> v;
    a[u][v] = 1;
    a[v][u] = 1;
  }
  if (n <= 6)
    cout << m << "\n";
  else {
    for (long long i = 1; i <= 7; i++) {
      for (long long j = i + 1; j <= 7; j++) {
        long long c = 0;
        for (long long l = 1; l <= 7; l++)
          if (a[i][l] == 1 && a[j][l] == 1) ++c;
        k = min(k, c);
      }
    }
    cout << m - k << "\n";
  }
  return 0;
}
