#include <bits/stdc++.h>
using namespace std;
int a[8][8];
int n, m, ans = 0x3f3f3f3f;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    a[u][v] = 1, a[v][u] = 1;
  }
  if (n <= 6) {
    printf("%d\n", m);
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) {
      int cur = 0;
      for (int k = 1; k <= n; ++k)
        if (a[k][i] && a[k][j]) ++cur;
      ans = min(ans, cur);
    }
  printf("%d\n", m - ans);
  return 0;
}
