#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const int mod = 1e9 + 7;
long long qpow(long long a, long long b) {
  long long ans = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
  }
  return ans;
}
long long gcd(long long a, long long b) { return b > 0 ? gcd(b, a % b) : a; }
int n, m, T;
int id[maxn];
vector<int> g[maxn];
bool vis[10][10];
int gao() {
  int x = 0;
  memset(vis, 0, sizeof vis);
  for (int i = 1; i <= n; i++) {
    for (auto v : g[i]) {
      if (vis[id[i]][id[v]]) continue;
      vis[id[i]][id[v]] = vis[id[v]][id[i]] = 1;
      x++;
    }
  }
  return x;
}
int cal(int t) {
  int res = 0, num = 0;
  for (int i = 1; i <= n; i++) {
    if (i != t) id[i] = ++num;
  }
  for (int i = 1; i <= 6; i++) {
    id[t] = i;
    res = max(res, gao());
  }
  return res;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int ans = 0;
  if (n <= 6) {
    ans = m;
  } else {
    for (int i = 1; i <= n; i++) {
      ans = max(ans, cal(i));
    }
  }
  cout << ans << endl;
  return 0;
}
