#include <bits/stdc++.h>
using namespace std;
int edges[8] = {0};
vector<int> e[8];
int mat[8][8];
int common(vector<int> &v1, vector<int> &v2) {
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  int i = 0, j = 0;
  int ans = 0;
  for (; i < v1.size() && j < v2.size();) {
    if (v1[i] == v2[j]) {
      ans++;
      i++;
      j++;
    } else if (v1[i] < v2[j]) {
      i++;
    } else {
      j++;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  int f, s;
  for (int i = 0; i < 8; i++) {
    for (int j = 0; j < 8; j++) {
      mat[i][j] = 0;
    }
  }
  for (int i = 0; i < m; i++) {
    cin >> f >> s;
    e[f].push_back(s);
    e[s].push_back(f);
    mat[f][s] = 1;
    mat[s][f] = 1;
    edges[f]++;
    edges[s]++;
  }
  int ans = INT_MAX;
  for (int i = 1; i < n + 1; i++) {
    ans = min(ans, edges[i]);
  }
  if (n != 7 || ans <= 1)
    cout << m << endl;
  else {
    if (ans == 6) {
      cout << m - ans + 1 << endl;
    } else {
      int pp = INT_MAX;
      for (int i = 1; i < n + 1; i++) {
        for (int j = i + 1; j < n + 1; j++) {
          pp = min(pp, common(e[i], e[j]));
        }
      }
      cout << m - pp << endl;
    }
  }
}
