#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  set<int> arr[n];
  int scores[n];
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    a--;
    b--;
    arr[a].insert(b);
    arr[b].insert(a);
    scores[a]++;
    scores[b]++;
  }
  if (n < 7) {
    cout << m << "\n";
    return 0;
  }
  int mx = -1;
  for (int i = 0; i < 7; i++) {
    for (int j = i + 1; j < 7; j++) {
      int count = 0;
      if (arr[i].find(j) != arr[i].end()) {
        count++;
      }
      set<int> temp;
      for (auto it = arr[i].begin(); it != arr[i].end(); it++) {
        if (*it == j) {
          continue;
        }
        temp.insert(*it);
      }
      for (auto it = arr[j].begin(); it != arr[j].end(); it++) {
        if (*it == i) {
          continue;
        }
        temp.insert(*it);
      }
      count += temp.size();
      int count2 = 0;
      for (int l = 0; l < 7; l++) {
        if (l == i || l == j) {
          continue;
        }
        for (auto it = arr[l].begin(); it != arr[l].end(); it++) {
          if (*it == i || *it == j) {
            continue;
          }
          count2++;
        }
      }
      count += count2 / 2;
      mx = max(mx, count);
    }
  }
  cout << mx << "\n";
}
