#include <bits/stdc++.h>
int main() {
  int n, m;
  std::cin >> n >> m;
  int i, j, k;
  int list[8];
  for (i = 0; i < 8; i++) list[i] = 0;
  int edges[8][8];
  for (i = 1; i < 8; i++) {
    for (j = 1; j < 8; j++) edges[i][j] = 0;
  }
  int a, b;
  for (i = 0; i < m; i++) {
    std::cin >> a >> b;
    edges[a][b]++;
    edges[b][a]++;
    list[a]++;
    list[b]++;
  }
  int min = 1000 * 1000 * 1000;
  int val;
  for (i = 1; i < 8; i++) {
    for (j = 1; j < 8; j++) {
      val = 0;
      for (k = 1; k < 8; k++) {
        if (edges[i][k] && edges[j][k]) val++;
      }
      if (val < min) min = val;
    }
  }
  if (min < 0) min = 0;
  std::cout << m - min << '\n';
  return 0;
}
