#include <bits/stdc++.h>
using namespace std;
int x[10][10];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    x[a][b] = x[b][a] = 1;
  }
  if (n < 7)
    cout << m << '\n';
  else {
    int sum = 30;
    for (int i = 1; i <= 7; i++) {
      for (int j = i + 1; j <= 7; j++) {
        int ans = 0;
        for (int o = 1; o <= 7; o++) {
          if (x[i][o] == 1 && x[j][o] == 1) ans++;
        }
        if (ans < sum) sum = ans;
      }
    }
    cout << m - sum << '\n';
  }
  return 0;
}
