#include <bits/stdc++.h>
using namespace std;
bool G[8][8];
int main() {
  int n, m;
  cin >> n >> m;
  if (n <= 6) {
    cout << m << endl;
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    G[u][v] = G[v][u] = true;
  }
  int mini = INT_MAX;
  for (int i = 1; i <= 7; i++) {
    for (int j = 1; j <= 7; j++) {
      if (j == i) continue;
      int cur = 0;
      for (int k = 1; k <= 7; k++) cur += G[i][k] & G[j][k];
      mini = min(mini, cur);
    }
  }
  cout << m - mini << endl;
}
