#include <bits/stdc++.h>
using namespace std;
vector<int> edges[8];
int calc(int a, int b) {
  vector<int> cnt(8);
  for (auto e : edges[a]) cnt[e]++;
  for (auto e : edges[b]) cnt[e]++;
  int sol = 0;
  for (int i = 1; i <= 7; i++)
    if (cnt[i] == 2) sol++;
  return sol;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  if (n <= 6) {
    cout << m << "\n";
    return 0;
  }
  int mmin = 1e9;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      mmin = min(mmin, calc(i, j));
    }
  }
  cout << m - mmin << "\n";
  return 0;
}
