#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chmin(T1& a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1& a, T2 b) {
  if (a < b) a = b;
}
const int MOD = 998244353;
const long long INF = 1e17;
const int INT_INF = 1e9;
const double pi = acos(-1);
const double EPS = 1e-10;
const int MAX = 300300;
int N, M;
vector<pair<int, int>> G;
vector<vector<int>> v;
int use[7][7];
int ans = 0;
void dfs(int n, vector<int> vec) {
  if (n == 7) {
    int res = 0;
    for (int i = 1; i < 7; i++) {
      for (int j = 1; j < 7; j++) {
        if (i <= j)
          use[i][j] = true;
        else
          use[i][j] = false;
      }
    }
    for (int i = 0; i < M; i++) {
      int u = G[i].first, v = G[i].second;
      int mi = vec[u], ma = vec[v];
      if (mi > ma) swap(mi, ma);
      if (use[mi][ma]) {
        res++;
        use[mi][ma] = 0;
      }
    }
    ans = max(ans, res);
  } else {
    for (int i = 1; i < 7; i++) {
      vector<int> nx = vec;
      nx.push_back(i);
      dfs(n + 1, nx);
    }
  }
}
void solve() {
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    if (u > v) swap(u, v);
    G.push_back({u, v});
  }
  vector<int> vec;
  dfs(0, vec);
  cout << ans << '\n';
  ;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
}
