#include <bits/stdc++.h>
using namespace std;
int g[8][8];
signed main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    g[a][b] = g[b][a] = 1;
  }
  if (n < 7) {
    cout << m;
    return 0;
  }
  int ans = 0;
  for (int i = 1; i <= 7; i++) {
    for (int j = i + 1; j <= 7; j++) {
      int cur = 0;
      for (int k = 1; k <= 7; k++) cur += (g[i][k] && g[j][k]);
      ans = max(ans, m - cur);
    }
  }
  cout << ans;
}
