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