#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int hs[10] = {0};
int save[N][2];
int ans = 0, n, m;
struct node {
  int x, i;
} deg[10];
int main() {
  cin >> n >> m;
  for (int i = 0; i < 10; i++) {
    deg[i].x = 0;
    deg[i].i = i;
  }
  for (int i = 1; i <= m; i++) {
    cin >> save[i][0] >> save[i][1];
    if (save[i][0] != 7 && save[i][1] != 7)
      deg[save[i][0]].x++;
    else
      deg[save[i][0]].x++, deg[save[i][1]].x++;
  }
  sort(deg + 1, deg + 8, [](node a, node b) { return a.x > b.x; });
  for (int i = 1; i <= 6; i++) hs[deg[i].i] = i;
  for (int pos = 1; pos <= 6; pos++) {
    hs[deg[7].i] = pos;
    set<pair<int, int>> sp;
    for (int i = 1; i <= m; i++) {
      sp.insert(make_pair(min(hs[save[i][0]], hs[save[i][1]]),
                          max(hs[save[i][0]], hs[save[i][1]])));
    }
    ans = max(ans, (int)sp.size());
  }
  for (int i = 1; i <= m; i++) {
    if (save[i][0] > save[i][1]) swap(save[i][0], save[i][1]);
    if (save[i][0] != 7 && save[i][1] != 7)
      deg[save[i][0]].x++;
    else
      deg[save[i][0]].x++, deg[save[i][1]].x++;
  }
  sort(deg + 1, deg + 8, [](node a, node b) { return a.x > b.x; });
  for (int i = 1; i <= 6; i++) hs[deg[i].i] = i;
  for (int pos = 1; pos <= 6; pos++) {
    hs[deg[7].i] = pos;
    set<pair<int, int>> sp;
    for (int i = 1; i <= m; i++) {
      sp.insert(make_pair(min(hs[save[i][0]], hs[save[i][1]]),
                          max(hs[save[i][0]], hs[save[i][1]])));
    }
    ans = max(ans, (int)sp.size());
  }
  cout << ans << endl;
}
