#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long powermodm(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long power(long long _a, long long _b) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a);
    _b /= 2;
    _a = (_a * _a);
  }
  return _r;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  long long x[m], y[m];
  for (int i = 0; i < m; i++) {
    cin >> x[i] >> y[i];
    if (x[i] > y[i]) {
      swap(x[i], y[i]);
    }
  }
  if (n <= 6) {
    cout << m << endl;
  } else {
    vector<long long> g;
    g.push_back(1);
    g.push_back(2);
    g.push_back(3);
    g.push_back(4);
    g.push_back(5);
    g.push_back(6);
    g.push_back(7);
    long long ans = 0;
    do {
      long long b[8];
      for (int i = 0; i < g.size(); i++) {
        if (i <= 1) {
          b[g[i]] = 1;
        } else {
          b[g[i]] = i;
        }
      }
      set<pair<long long, long long>> s;
      for (int i = 0; i < m; i++) {
        long long x1 = b[x[i]];
        long long x2 = b[y[i]];
        if (x1 > x2) {
          swap(x1, x2);
        }
        s.insert({x1, x2});
      }
      long long x = s.size();
      ans = max(ans, x);
    } while (next_permutation(g.begin(), g.end()));
    cout << ans << endl;
  }
  return 0;
}
