#include <bits/stdc++.h>
using namespace std;
const int LIMIT = 2e5 + 7;
int n, m, u, v, r = 7;
bool a[8][8];
vector<int> g[LIMIT];
int main() {
  scanf("%d %d", &n, &m);
  if (n < 7) {
    printf("%d", min(m, 21));
    return EXIT_SUCCESS;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &u, &v);
    a[u][v] = true;
    a[v][u] = true;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= 7; i++) {
    for (int j = i + 1; j <= 7; j++) {
      int adjacent = 0;
      for (int q = 1; q <= 7; q++) {
        if (a[i][q] && a[q][j]) {
          adjacent++;
        }
      }
      r = min(r, adjacent);
    }
  }
  printf("%d", m - r);
  return EXIT_SUCCESS;
}
