#include <bits/stdc++.h>
using namespace std;
int process(vector<vector<bool>> G, vector<int> c, int n) {
  int answer = 0;
  vector<vector<bool>> used(6, vector<bool>(6));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (G[i][j] && !used[c[i]][c[j]] && ++answer) {
        used[c[i]][c[j]] = true;
        used[c[j]][c[i]] = true;
      }
    }
  }
  return answer;
}
int main() {
  int a, b, n, m, answer = 0;
  cin >> n;
  vector<vector<bool>> G(n, vector<bool>(n));
  for (cin >> m; m; m--) {
    cin >> a >> b;
    G[--a][--b] = true;
    G[b][a] = true;
  }
  for (int i = 0; i < 6; i++) {
    vector<int> c;
    for (int j = 0; j < i; j++) c.push_back(j);
    c.push_back(i);
    c.push_back(i);
    for (int j = i + 1; j < 6; j++) c.push_back(j);
    do {
      answer = max(answer, process(G, c, n));
    } while (next_permutation(c.begin(), c.end()));
  }
  cout << answer;
}
