#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b, mn = 1e9, x, ar[10][10];
int main() {
  cin >> n >> m;
  if (n <= 6) {
    cout << m << endl;
    return 0;
  }
  for (long long i = 0; i < m; i++) {
    cin >> a >> b;
    ar[a][b] = 1;
    ar[b][a] = 1;
  }
  for (long long i = 1; i <= 7; i++)
    for (long long j = 1; j <= 7; j++) {
      x = 0;
      for (long long k = 1; k <= 7; k++)
        if (ar[i][k] && ar[k][j]) x++;
      mn = min(mn, x);
    }
  cout << m - mn;
}
