#include <bits/stdc++.h>
using namespace std;
long long cnt[8], tot[8], check[8][8], Check[8][8];
signed main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  long long ans = 0;
  set<long long> nodes;
  vector<pair<long long, long long> > pi;
  vector<long long> g[8];
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
    nodes.insert({u, v});
    check[u][v] = check[v][u] = Check[u][v] = Check[v][u] = 1;
    cnt[u] += 1;
    cnt[v] += 1;
  }
  for (long long i = 1; i <= n; i++) {
    pi.push_back({cnt[i], i});
  }
  if (nodes.size() < 7) {
    cout << m << "\n";
  } else {
    for (long long i = 1; i <= n; i++) {
      long long k = i;
      long long Cnt = 0, mx = 0;
      for (long long h = 0; h < pi.size(); h++) {
        long long a = pi[h].first;
        long long b = pi[h].second;
        cnt[b] = a;
        for (auto c : g[b]) {
          check[c][b] = check[b][c] = Check[c][b] = Check[b][c] = 1;
        }
      }
      for (long long j = 0; j < pi.size(); j++) {
        long long a = pi[j].second;
        if (a == k) continue;
        if (check[k][a] && check[a][k]) {
          cnt[a] -= 1;
        }
      }
      for (long long i = 0; i < pi.size(); i++) {
        long long a = pi[i].second;
        if (a == k) continue;
        Cnt += cnt[a];
        for (long long j = 0; j < pi.size(); j++) {
          long long b = pi[j].second;
          if (b == k) continue;
          if (check[a][b] && check[b][a]) {
            cnt[b] -= 1;
            check[a][b] = check[b][a] = 0;
          }
        }
      }
      for (long long i = 0; i < pi.size(); i++) {
        long long a = pi[i].second;
        if (a == k) continue;
        long long ant = 0;
        for (auto u : g[k]) {
          if (Check[a][u] == 0 && Check[u][a] == 0) {
            ant += 1;
          }
        }
        mx = max(mx, ant);
      }
      long long need = cnt[k];
      if (mx >= need) {
        Cnt += need;
      } else {
        Cnt += mx;
      }
      ans = max(ans, Cnt);
    }
    cout << ans << "\n";
  }
  return 0;
}
