#include <bits/stdc++.h>
using namespace std;
int n, m, ans, dp[8][8];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int l, r;
    cin >> l >> r;
    dp[l][r] = dp[r][l] = 1;
  }
  if (n <= 6)
    cout << m;
  else {
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++) {
        int res = 0;
        for (int k = 1; k <= n; k++)
          if (dp[i][k] && dp[j][k]) res++;
        ans = max(ans, m - res);
      }
    cout << ans;
  }
}
