#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << 0 << endl;
    return 0;
  }
  map<pair<int, int>, int> dom;
  map<pair<int, int>, int> edg;
  vector<vector<int>> ng(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    edg[make_pair(a - 1, b - 1)] = 0;
    edg[make_pair(b - 1, a - 1)] = 0;
    ng[a - 1].push_back(b - 1);
    ng[b - 1].push_back(a - 1);
  }
  if (n < 7) {
    cout << m << endl;
    return 0;
  }
  vector<int> flag(n, -1);
  int res = 0;
  for (int l = 0; l < n; l++) {
    for (int b = l + 1; b < n; b++) {
      int ans = 0;
      int fl = 1;
      for (int k = 0; k < n; k++) {
        if (k == l || k == b)
          flag[k] = 6;
        else {
          flag[k] = fl;
          fl++;
        }
      }
      auto itr = edg.begin();
      while (itr != edg.end()) {
        itr->second = 0;
        itr++;
      }
      for (int i = 1; i < 7; i++) {
        for (int j = i; j < 7; j++) {
          dom[make_pair(i, j)] = 1;
        }
      }
      for (int i = 0; i < n; i++) {
        int node = i;
        int fl1 = flag[node];
        for (int j = 0; j < ng[node].size(); j++) {
          if (edg[make_pair(node, ng[node][j])] == 0) {
            int fl2 = flag[ng[node][j]];
            int a = min(fl1, fl2), b = max(fl1, fl2);
            if (dom[make_pair(a, b)] == 1) {
              ans++;
              dom[make_pair(a, b)] = 0;
              edg[make_pair(node, ng[node][j])] = 1;
              edg[make_pair(ng[node][j], node)] = 1;
            }
          }
        }
      }
      res = max(res, ans);
    }
  }
  cout << res << endl;
  return 0;
}
