#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
int n, m, mp[110][110];
int ans = 1e5;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    mp[u][v] = mp[v][u] = 1;
  }
  if (n <= 6)
    cout << m << endl;
  else {
    for (int i = 1; i <= 7; i++) {
      for (int j = i + 1; j <= 7; j++) {
        int res = 0;
        for (int k = 1; k <= 7; k++) {
          if (k != i && k != j && mp[k][i] && mp[k][j]) res++;
        }
        ans = min(ans, res);
      }
    }
    cout << m - ans << endl;
  }
  return 0;
}
