#include <bits/stdc++.h>
using namespace std;
const int INF = (long long int)(1LL << 30) - 1;
const double INFd = 100000000000.0;
const long long int INFl = (long long int)9223372036854775807 / 5;
const int MAX = 10000;
const long long int MOD = (long long int)1e9 + 7;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
int dx[4] = {0, -1, 0, 1}, dy[4] = {-1, 0, 1, 0};
int mdx[8] = {0, 1, 0, -1, 1, 1, -1, -1}, mdy[8] = {-1, 0, 1, 0, 1, -1, 1, -1};
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
int n, m;
vector<int> t[8];
int main() {
  cin >> n >> m;
  if (n < 7) {
    cout << m << endl;
    return 0;
  }
  if (n == 7 && m == 0) {
    cout << 0 << endl;
    return 0;
  }
  for (long long int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    t[a].push_back(b);
    t[b].push_back(a);
  }
  int co[8];
  int al = 100;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      for (long long int k = 0; k < 8; k++) co[k] = 0;
      int tt = 0;
      for (long long int k = 0; k < t[i].size(); k++) {
        co[t[i][k]]++;
      }
      for (long long int k = 0; k < t[j].size(); k++) {
        co[t[j][k]]++;
      }
      for (int i = 1; i <= 7; i++) {
        if (co[i] >= 2) tt++;
      }
      al = ((al) < (tt) ? (al) : (tt));
    }
  }
  cout << m - al << endl;
  return 0;
}
