#include <bits/stdc++.h>
using namespace std;
void dfs(int v, int from) {}
int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  int adj[n + 1][n + 1];
  memset(adj, 0, sizeof adj);
  for (int i = 0; i < m; ++i) {
    cin >> a >> b;
    adj[a][b] = adj[b][a] = 1;
  }
  if (n <= 6) {
    cout << m << endl;
    return 0;
  }
  int mini = m;
  for (int i = 1; i <= 7; ++i) {
    for (int j = 1; j <= 7; ++j) {
      int cnt = 0;
      for (int k = 1; k <= 7; ++k) {
        if (adj[i][k] && adj[j][k]) cnt++;
      }
      mini = min(mini, cnt);
    }
  }
  cout << m - mini << endl;
}
