#include <bits/stdc++.h>
using namespace std;
bool adj[8][8];
signed main() {
  std ::ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, m;
  cin >> n >> m;
  if (n != 7) {
    cout << m;
    return 0;
  }
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    adj[u][v] = 1;
    adj[v][u] = 1;
  }
  long long best = 0;
  for (long long i = 1; i < 8; i++) {
    for (long long j = i + 1; j < n; j++) {
      long long curr = m;
      for (long long k = 1; k < 8; k++) {
        curr -= adj[i][k] && adj[k][j];
      }
      best = max(best, curr);
    }
  }
  cout << best;
}
