#include <bits/stdc++.h>
using namespace std;
const int maxn = 10;
int n, m, res, cnt[maxn];
bool e[maxn][maxn];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  int u, v;
  memset(e, 0, sizeof(e));
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    e[u][v] = 1;
    e[v][u] = 1;
    cnt[u]++;
    cnt[v]++;
  }
  if (n < 7) {
    cout << m;
    return 0;
  }
  for (int i = 1; i <= 7; i++)
    if (cnt[i] == 0) {
      cout << m;
      return 0;
    }
  int res = 0;
  for (int i = 1; i <= 6; i++)
    for (int j = i + 1; j <= 7; j++) {
      int count = 0;
      for (int k = 1; k <= 7; k++)
        if (e[i][k] && e[k][j]) count++;
      res = max(res, max(m - cnt[j] + min(7 - cnt[i], cnt[j] - count),
                         m - cnt[i] + min(7 - cnt[j], cnt[i] - count)));
    }
  cout << res;
  return 0;
}
