#include <bits/stdc++.h>
using namespace std;
int n, m, d[8][8], b[8];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    d[x][y] = 1;
    d[y][x] = 1;
    b[x]++;
    b[y]++;
  }
  if (n < 7) {
    printf("%d", m);
    return 0;
  }
  int x = -1;
  for (int i = 1; i <= 7; i++)
    for (int j = i + 1; j <= 7; j++) {
      int t = m - b[i] - b[j] + 2 * d[i][j];
      for (int k = 1; k <= 7; k++)
        if (k != i && k != j) t += (d[i][k] | d[j][k]);
      x = max(t, x);
    }
  printf("%d", x);
}
