#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<vector<int> > g(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    g[a - 1].push_back(b - 1);
    g[b - 1].push_back(a - 1);
  }
  if (n < 7) {
    cout << m;
  } else {
    int best = 7;
    for (int i = 0; i < 7; ++i) {
      for (int j = i + 1; j < 7; ++j) {
        int x = 0;
        for (int k = 0; k < g[i].size(); k++) {
          for (int h = 0; h < g[j].size(); h++) {
            if (g[i][k] == g[j][h]) {
              x++;
            }
          }
        }
        if (x < best) {
          best = x;
        }
      }
    }
    cout << m - best;
  }
  return 0;
}
