#include <bits/stdc++.h>
int n, m, id[8], cnt[6], ad[8], res;
bool g[8][8], p[6][6];
void Prepare() {
  std::cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    std::cin >> u >> v;
    --u, --v;
    g[u][v] = g[v][u] = 1;
    ++ad[u], ++ad[v];
  }
  for (int i = 0; i < n; i++) id[i] = i;
}
void Trial(int id[]) {
  for (int i = 0; i < 6; i++) std::fill(p[i], p[i] + 6, 1);
  int re = 0;
  for (int i = 0; i < 6; i++)
    for (int j = i + 1; j < 6; j++) {
      if (!g[id[i]][id[j]]) continue;
      p[i][j] = p[j][i] = 0, ++re;
    }
  std::fill(cnt, cnt + 6, 0);
  for (int i = 0; i < 6; i++)
    if (g[id[i]][id[6]])
      for (int j = 0; j < 6; j++) cnt[j] += p[i][j];
  res =
      std::max(res, re + std::min(ad[id[6]], *std::max_element(cnt, cnt + 6)));
}
void Process() {
  res = 0;
  if (n != 7)
    res = m;
  else
    for (int i = 0; i < 7; i++) {
      std::swap(id[i], id[6]);
      Trial(id);
      std::swap(id[i], id[6]);
    }
  std::cout << res;
}
int main() {
  std::ios_base::sync_with_stdio(0);
  std::cin.tie(0);
  Prepare();
  Process();
}
