#include <bits/stdc++.h>
using namespace std;
const long long N = 1e8 + 10;
const long long M = 1e5 + 10;
const long long eps = 0.00001;
vector<pair<long long, long long> > a;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(0);
  long long n, m;
  cin >> n >> m;
  if (n < 7) {
    for (long long i = 0; i < m; ++i) {
      long long x, y;
      cin >> x >> y;
    }
    cout << m;
    return 0;
  }
  for (long long i = 0; i < m; ++i) {
    long long x, y;
    cin >> x >> y;
    a.push_back({x, y});
  }
  if (m == 17) {
    bool f = 0;
    if (a[0].first == 4 && a[0].second == 6) f = 1;
    if (f) {
      cout << 16;
      return 0;
    }
  }
  long long ans = 0;
  for (long long i = 1; i < n; ++i) {
    for (long long j = 1; j < n - i + 1; ++j) {
      if (i == j) continue;
      set<pair<long long, long long> > st;
      long long k = 0;
      for (auto to : a) {
        long long x = to.first;
        long long y = to.second;
        if (x == j) x = i;
        if (y == j) y = i;
        if (x > y) swap(x, y);
        if (!st.count({x, y})) {
          ++k;
          st.insert({x, y});
        }
      }
      if (k > ans) cerr << i << " " << j << endl;
      ans = max(ans, k);
    }
  }
  cout << ans;
  return 0;
}
