#include <bits/stdc++.h>
using namespace std;
int a[8][8], f[10];
int mod(int a, int b) {
  if (a > b) return a - b;
  return b - a;
}
int main() {
  int x, y, n, m, c7 = 0;
  int cate = 100;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    a[x][y] = a[y][x] = 1;
    if (x == 7) c7++;
    if (y == 7) c7++;
    if (x != 7 && y != 7) cate++;
  }
  if (n <= 6)
    cout << m;
  else {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= n; j++) {
        int p = 0;
        for (int k = 1; k <= n; k++)
          if (a[k][i] && a[j][k]) p++;
        if (p < cate) cate = p;
      }
    cout << m - cate;
  }
  return 0;
}
