#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  while (cin >> n >> m) {
    int g[10][10] = {0};
    for (int i = 0; i < m; i++) {
      int u, v;
      cin >> u >> v;
      g[u][v] = 1;
      g[v][u] = 1;
    }
    if (n <= 6) {
      cout << m << "\n";
      continue;
    }
    int minn = 0x3f3f3f3f;
    for (int i = 1; i <= 7; i++) {
      for (int j = 1; j <= 7; j++) {
        int cnt = 0;
        for (int k = 1; k <= 7; k++) {
          if (g[i][k] && g[j][k]) cnt++;
        }
        minn = min(minn, cnt);
      }
    }
    cout << m - minn << "\n";
  }
  return 0;
}
