#include <bits/stdc++.h>
using namespace std;
int const maxn = 100 + 10;
inline int lc(int x) { return x << 1; }
inline int rc(int x) { return x << 1 | 1; }
int e[maxn][maxn];
int main(void) {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    e[u][v] = e[v][u] = 1;
  }
  if (n <= 6) {
    cout << m << endl;
  } else {
    int ans = 10;
    for (int i = 1; i <= 7; i++) {
      for (int j = i + 1; j < 7; j++) {
        int x = 0;
        for (int k = 1; k <= 7; k++) {
          if (e[i][k] && e[k][j]) {
            x++;
          }
        }
        ans = min(ans, x);
      }
    }
    cout << m - ans << endl;
  }
  return 0;
}
