#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 100;
const long long INF = 9 * (long long)(1e18);
const long double PI = 3.14159265358979323846;
long long int modexp(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res % p;
}
vector<int> is_prime(N + 1, 1);
void sieve(long long int n) {
  is_prime[0] = is_prime[1] = 0;
  for (long long int i = 2; i * i <= n; i++) {
    if (is_prime[i]) {
      for (long long int j = i * i; j <= n; j += i) is_prime[j] = 0;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  vector<long long int> g[n + 1];
  for (long long int i = 1; i <= m; i++) {
    long long int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (n <= 6)
    cout << m << "\n";
  else {
    int gp[8][8];
    for (long long int i = 1; i <= 7; i++) {
      for (long long int j = 1; j <= 7; j++) gp[i][j] = 0;
    }
    for (long long int i = 1; i <= 7; i++) {
      for (long long int j = 0; j <= (int)g[i].size() - 1; j++)
        gp[i][g[i][j]] = 1;
    }
    long long int dist = INF;
    for (long long int i = 1; i <= 7; i++) {
      for (long long int j = i + 1; j <= 7; j++) {
        long long int s = 0;
        for (long long int k = 1; k <= 7; k++) {
          if (gp[i][k] && gp[j][k]) s++;
        }
        dist = min(dist, s);
      }
    }
    cout << m - dist << "\n";
  }
}
