#include <bits/stdc++.h>
using namespace std;
int matrix[10][10];
int main() {
  int i, a, b, n, m, ans;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    matrix[a][b] = 1;
    matrix[b][a] = 1;
  }
  if (n < 7) {
    cout << m << endl;
    return 0;
  }
  int d = 1000;
  for (i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      int u = 0;
      for (int q = 1; q <= n; q++) {
        if (matrix[i][q] && matrix[j][q]) {
          u++;
        }
      }
      d = min(d, u);
    }
  }
  cout << (m - d) << endl;
  return 0;
}
