#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int SUM = 0, ff = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') ff = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    SUM = (SUM << 3) + (SUM << 1) + (ch ^ 48);
    ch = getchar();
  }
  return SUM * ff;
}
const int N = 10;
bool g[N][N];
int n, m;
int main() {
  n = read(), m = read();
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    g[x][y] = g[y][x] = 1;
  }
  if (n <= 6) {
    printf("%d\n", m);
    return 0;
  }
  int minedge = 100;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      int cnt = 0;
      for (int k = 1; k <= n; k++)
        if (g[k][i] && g[k][j]) cnt++;
      minedge = min(minedge, cnt);
    }
  printf("%d\n", m - minedge);
  return 0;
}
