#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
void solve();
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << fixed << setprecision(10);
  int t = 1;
  while (t--) solve();
  return 0;
}
void solve() {
  int n, m;
  cin >> n >> m;
  if (n <= 6) {
    cout << m << "\n";
    return;
  }
  assert(n == 7);
  vector<vector<int>> g(n, vector<int>());
  for (int i = 0; i < (int)m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  vector<int> val = {1, 1, 2, 3, 4, 5, 6};
  set<pair<int, int>> taken;
  int mx = -1;
  do {
    taken.clear();
    for (int i = 0; i < (int)n; i++) {
      for (int j = 0; j < (int)g[i].size(); j++) {
        int t0 = val[i];
        int t1 = val[g[i][j]];
        if (t0 <= t1)
          taken.insert({t0, t1});
        else
          taken.insert({t1, t0});
      }
    }
    mx = max(mx, (int)taken.size());
  } while (next_permutation((val).begin(), (val).end()));
  cout << mx << "\n";
}
