#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, n, m, c, t, a, b, mx = -2888;
  set<pair<long long, long long> > s;
  vector<pair<long long, long long> > v;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    scanf("%lld %lld", &a, &b);
    v.push_back(make_pair(min(a, b), max(a, b)));
  }
  if (n <= 6) {
    cout << m << "\n";
    return 0;
  }
  for (j = 1; j <= 7; j++) {
    for (k = 1; k <= 7; k++) {
      if (k == j) continue;
      s.clear();
      for (i = 0; i < m; i++) {
        a = v[i].first;
        b = v[i].second;
        if (b == k) b = j;
        if (a == k) a = j;
        s.insert(make_pair(min(a, b), max(a, b)));
      }
      c = s.size();
      mx = max(mx, c);
    }
  }
  cout << mx << "\n";
}
