#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
int common(vector<int> a, vector<int> b) {
  int ans = 0;
  for (auto x : a) {
    for (auto y : b) {
      if (x == y) ans++;
    }
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > adj(n + 1);
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  if (n <= 6) {
    cout << m << '\n';
  } else {
    int ans = -1;
    for (int i = 1; i <= 7; i++) {
      for (int j = 1; j <= 7; j++) {
        if (i == j) continue;
        ans = max(ans, m - common(adj[i], adj[j]));
        debug() << " ["
                << "common(adj[i], adj[j])"
                   ": "
                << (common(adj[i], adj[j]))
                << "] "
                   " ["
                << "i"
                   ": "
                << (i)
                << "] "
                   " ["
                << "j"
                   ": "
                << (j)
                << "] "
                   " ["
                << "ans"
                   ": "
                << (ans) << "] ";
      }
    }
    cout << ans << '\n';
  }
}
