#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y, i, j;
  cin >> n >> m;
  int v[8] = {0};
  int g[8][8];
  memset(g, 0, sizeof(g));
  for (i = 0; i < m; i++) {
    cin >> x >> y;
    g[x][y] = 1;
    g[y][x] = 1;
    v[x]++;
    v[y]++;
  }
  if (n <= 6) {
    cout << m;
    return 0;
  }
  int mn = 10, nx = 1, ans = 0;
  for (int ii = 1; ii <= 7; ii++) {
    mn = v[ii];
    nx = ii;
    int mx = 0, cx;
    for (i = 1; i <= 7; i++) {
      cx = 0;
      for (j = 1; j <= 7; j++) {
        if (g[i][j] == 0 && g[nx][j] == 1) {
          cx++;
        }
      }
      mx = max(mx, cx);
    }
    ans = max(ans, m - mn + mx);
  }
  cout << ans;
  return 0;
}
