#include <bits/stdc++.h>
using namespace std;
const int mxN = 10;
vector<vector<bool> > edges(mxN, vector<bool>(mxN));
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    edges[u][v] = edges[v][u] = true;
  }
  if (n <= 6) {
    cout << m << "\n";
    return 0;
  }
  int Min_Removed = 1e9;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      int x = 0;
      for (int k = 1; k <= n; k++) {
        if (edges[i][k] && edges[k][j]) {
          x++;
        }
      }
      Min_Removed = min(Min_Removed, x);
    }
  }
  cout << m - Min_Removed << "\n";
  return 0;
}
