#include <bits/stdc++.h>
using namespace std;
int countTiles(vector<pair<int, int>>& edges, map<int, int>& to) {
  set<pair<int, int>> vis;
  for (auto x : edges) {
    pair<int, int> p = {to[x.first], to[x.second]};
    pair<int, int> rp = {to[x.second], to[x.first]};
    if (vis.find(p) != vis.end() || vis.find(rp) != vis.end()) continue;
    vis.insert(p);
  }
  return vis.size();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) {
    int n, m;
    cin >> n >> m;
    vector<pair<int, int>> edges(m);
    for (int i = 0; i < m; i++) {
      cin >> edges[i].first >> edges[i].second;
    }
    int a[8];
    for (int i = 1; i <= n; i++) {
      a[i] = i;
    }
    int res = 0;
    do {
      map<int, int> to;
      int r = 0;
      for (int i = 1; i <= n; i++) {
        to[i] = a[i];
        if (a[i] == 7) r = i;
      }
      for (int i = 1; i <= 6; i++) {
        to[r] = i;
        res = max(res, countTiles(edges, to));
      }
    } while (next_permutation(a + 1, a + n + 1));
    cout << res << endl;
  }
  return 0;
}
