#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, a, b;
  cin >> n >> m;
  vector<int> adj[n + 1];
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  if (n < 7) {
    cout << m;
    return 0;
  }
  int ans = 0, minsize = 10;
  for (int i = 1; i <= 7; i++) {
    int temp = m - adj[i].size();
    minsize = min(minsize, (int)adj[i].size());
    bool done[7][7] = {};
    for (int j = 1; j <= 7; j++)
      if (j != i) {
        for (int lol = 0; lol < adj[j].size(); lol++) {
          int k = adj[j][lol];
          if (k != i) {
            if (max(j, k) == 7) {
              done[min(j, k)][i] = true;
              done[i][min(j, k)] = true;
            } else {
              done[k][j] = true;
              done[j][k] = true;
            }
          }
        }
      }
    for (int label = 1; label <= 6; label++) {
      int maxinc = 0;
      for (int lol = 0; lol < adj[i].size(); lol++) {
        int k = adj[i][lol];
        if (k < 7 && !done[label][k]) maxinc++;
      }
      ans = max(ans, temp + maxinc);
    }
  }
  ans = max(ans, m - minsize);
  cout << ans;
  return 0;
}
