#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int maxN = 100100;
long long mat[10][10];
void solve() {
  long long n, m, cnt = 0, f = 0;
  cin >> n >> m;
  if (n < 7) {
    cout << m << endl;
    return;
  }
  long long a[m], b[m], mi = 1000;
  for (long long i = 0; i < (m); ++i)
    cin >> a[i] >> b[i], mat[a[i]][b[i]]++, mat[b[i]][a[i]]++;
  for (long long i = 1; i <= (6); ++i)
    for (long long j = i + 1; j <= (7); ++j) {
      long long sub = 0;
      for (long long k = 1; k <= (7); ++k)
        if (mat[i][k] && mat[j][k]) sub++;
      mi = min(mi, sub);
    }
  cout << m - mi << endl;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  solve();
  return 0;
}
