#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 6;
int a[10][10];
int main() {
  memset(a, 0, sizeof(a));
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    a[u][v] = 1;
    a[v][u] = 1;
  }
  if (n <= 6) {
    printf("%d\n", m);
  } else {
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        int cnt = m;
        for (int k = 1; k <= n; k++) {
          if (a[i][k] && a[j][k]) cnt--;
        }
        ans = max(ans, cnt);
      }
    }
    printf("%d\n", ans);
  }
}
