#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, c[10], cnt, ans = 0, temp;
  vector<pair<int, int> > edge;
  pair<int, int> u;
  bool used[10][10];
  scanf("%d %d", &n, &m);
  if (n < 7) {
    printf("%d\n", m);
    return 0;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    edge.push_back(make_pair(a, b));
  }
  for (int i = 1; i < 8; i++)
    for (int j = i + 1; j < 8; j++) {
      c[i] = c[j] = cnt = 1;
      for (int k = 1; k < 8; k++)
        if ((k != i) && (k != j)) c[k] = ++cnt;
      temp = 0;
      memset(used, false, sizeof used);
      for (int k = 0; k < m; k++) {
        u = edge[k];
        a = min(c[u.first], c[u.second]);
        b = max(c[u.first], c[u.second]);
        if (!used[a][b]) {
          temp++;
          used[a][b] = true;
        }
      }
      ans = max(ans, temp);
    }
  printf("%d\n", ans);
  return 0;
}
