#include <bits/stdc++.h>
const long long INF = 1e24;
const long long N = 2e6 + 77;
const long long MOD = 1e9 + 7;
using namespace std;
vector<long long> prime, g[N];
long long n, m, k, a[N];
long long POWER(long long base, long long expo) {
  long long ret = 1;
  while (expo) {
    if (expo & 1) ret = ret * base;
    expo >>= 1;
    base = base * base;
  }
  return ret;
}
int main() {
  long long test_case = 1;
  while (test_case--) {
    cin >> n >> m;
    for (long long i = 1; i <= m; i++) {
      long long x, y;
      cin >> x >> y;
      g[x].push_back(y);
      g[y].push_back(x);
    }
    if (n < 7) {
      cout << m;
      return 0;
    }
    vector<long long>::iterator it;
    long long remove_after_merge = INF;
    for (long long i = 1; i <= 6; i++) {
      for (long long j = i + 1; j <= 7; j++) {
        long long r = 0;
        for (long long k = 0; k < g[i].size(); k++) {
          long long y = g[i][k];
          it = find(g[j].begin(), g[j].end(), y);
          if (it != g[j].end()) r++;
        }
        remove_after_merge = min(r, remove_after_merge);
      }
    }
    cout << m - remove_after_merge;
  }
  return 0;
}
