#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int next, to;
} ed[200000 + 5];
int last[200000 + 5], mark[200000 + 5], cnt[100], ecnt = 0, n, m;
void addEdge(int u, int v) {
  ed[++ecnt].to = v, ed[ecnt].next = last[u], last[u] = ecnt;
}
int mx = 0;
void check() {
  memset(cnt, 0, sizeof(cnt));
  int ans = 0;
  for (int u = 1; u <= n; u++)
    for (int i = last[u]; i; i = ed[i].next) {
      int v = ed[i].to, fu = mark[u], fv = mark[v];
      if (fu > fv) swap(fu, fv);
      cnt[fu * 10 + fv]++;
    }
  for (int i = 1; i <= 6; i++) {
    for (int j = i; j <= 6; j++) {
      if (cnt[i * 10 + j]) ans++;
    }
  }
  bool flag = 1;
  for (int i = 1; i <= 6; i++)
    if (i != mark[i]) flag = 0;
  mx = max(mx, ans);
}
void getAns(int u) {
  if (u > n) {
    check();
    return;
  }
  for (int i = 1; i <= 6; i++) mark[u] = i, getAns(u + 1), mark[u] = i;
}
int main(int argc, char const *argv[]) {
  scanf("%d%d", &n, &m);
  mx = 0;
  memset(last, 0, sizeof(last));
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    addEdge(u, v);
  }
  getAns(1);
  printf("%d\n", mx);
  return 0;
}
