#include <bits/stdc++.h>
using namespace std;
const int N = 200005, BIG = 0x3f3f3f3f;
int n, m, ct = 0;
int d[6][6], key[8];
vector<vector<int> > adj;
bool Read() {
  cin >> n;
  if (cin.eof()) return 0;
  cin >> m;
  adj.assign(n + 1, vector<int>());
  int u, v;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  return 1;
}
void Lay_Pieces(int u) {
  int k1, k2;
  for (int v : adj[u]) {
    k1 = min(key[u], key[v]);
    k2 = max(key[u], key[v]);
    if (d[k1][k2] == 0) d[k1][k2] = 1;
  }
}
int Solve(int u, int v) {
  memset(d, 0, sizeof d);
  int temp = key[u] = key[v] = 0;
  for (int i = 1; i < 8; i++)
    if (i != u && i != v) key[i] = ++temp;
  for (int i = 1; i < 8; i++) Lay_Pieces(i);
  int ans = 0;
  for (int i = 0; i < 6; i++)
    for (int j = i; j < 6; j++) ans += d[i][j];
  return ans;
}
void Process() {
  if (n < 7 || m < 7) {
    cout << m << "\n";
    return;
  }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++) ans = max(ans, Solve(i, j));
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  while (Read()) Process();
  return 0;
}
