#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> vec;
bool linked(int a, int b) {
  for (pair<int, int> p : vec) {
    if ((p.first == a && p.second == b) || (p.first == b && p.second == a)) {
      return true;
    }
  }
  return false;
}
int main() {
  int n, m;
  cin >> n >> m;
  if (n <= 6) {
    cout << m << endl;
    return 0;
  }
  for (int i = 0; i < m; ++i) {
    int x, y;
    cin >> x >> y;
    vec.emplace_back(pair<int, int>(x, y));
  }
  int minimum = 7;
  for (int a = 1; a <= 7; ++a) {
    for (int b = a + 1; b <= 7; ++b) {
      int match = 0;
      for (int i = 1; i <= 7; ++i) {
        if (linked(a, i) && linked(b, i)) {
          ++match;
        }
      }
      if (match < minimum) {
        minimum = match;
      }
    }
  }
  cout << m - minimum << endl;
}
