#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long g, h, l;
const long long N = 100005, inf = 1e9 + 5;
vector<long long> adj[7];
bool vis[7] = {false};
long long add(long long a, long long b);
long long mul(long long a, long long b);
long long binpo(long long a, long long b);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    cin >> g >> h;
    g--;
    h--;
    adj[g].push_back(h);
    adj[h].push_back(g);
  }
  if (n < 7) {
    cout << m;
    return 0;
  }
  long long ans = 0;
  for (long long i = 0; i < 7; i++) {
    for (long long j = 0; j < 7; j++) {
      if (i == j) {
        continue;
      }
      memset(vis, false, sizeof(vis));
      long long cnt = 0;
      for (auto node : adj[i]) {
        if (node == j) continue;
        vis[node] = true;
      }
      for (auto node : adj[j]) {
        if (node == i) continue;
        if (vis[node]) cnt++;
        vis[node] = true;
      }
      ans = max(ans, m - cnt);
    }
  }
  cout << ans;
}
long long add(long long a, long long b) { return (a % MOD + b % MOD) % MOD; }
long long mul(long long a, long long b) { return (a * 1ll * b) % MOD; }
long long binpo(long long a, long long b) {
  int ans = 1;
  while (b) {
    if (b % 2 != 0) {
      ans = mul(ans, a);
    }
    a = mul(a, a);
    b = b / 2;
  }
  return ans;
}
