#include <bits/stdc++.h>
using namespace std;
int kor[10];
pair<int, int> povez[50];
bool povezani(int a, int b, int m) {
  for (int i = 0; i < m; i++) {
    if ((povez[i].first == a && povez[i].second == b) ||
        (povez[i].first == b && povez[i].second == a))
      return true;
  }
  return false;
}
int trougao(int a, int b, int m) {
  int k = 0;
  for (int i = 1; i <= 7; i++) {
    if (i == a || i == b) continue;
    if (povezani(i, a, m) && povezani(i, b, m)) k++;
  }
  return k;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, a, b, br = 0, mini = 69;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    povez[i].first = a;
    povez[i].second = b;
    kor[a]++;
    kor[b]++;
  }
  for (int i = 1; i <= 7; i++)
    if (kor[i] == 0) {
      cout << m;
      return 0;
    }
  for (int i = 1; i <= 6; i++) {
    for (int j = i + 1; j <= 7; j++) {
      if (trougao(i, j, m) < mini) mini = trougao(i, j, m);
    }
  }
  cout << m - mini;
  return 0;
}
