#include <bits/stdc++.h>
using namespace std;
const long long mx = 200001;
const long long mod = 1e9 + 7;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long extgcd(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1;
  long long d = extgcd(b, a % b, x1, y1);
  x = y1;
  y = x1 - y1 * (a / b);
  return d;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool isPowerOfTwo(long long n) {
  if (n == 0) return false;
  return (ceil(log2(n)) == floor(log2(n)));
}
long long powm(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long divide(long long a, long long b) {
  return (a % mod) * powm(b, mod - 2) % mod;
}
long long mul(long long a, long long b) {
  return ((a % mod) * (b % mod)) % mod;
}
long long add(long long a, long long b) { return (a % mod + b % mod) % mod; }
long long Totfun(long long n) {
  long long z = n;
  if (n % 2 == 0) {
    while (n % 2 == 0) {
      n /= 2;
    }
    z /= 2;
  }
  for (long long i = 3; i <= sqrt(n); i += 2) {
    if (isPrime(i) && n % i == 0) {
      while (n % i == 0) {
        n /= i;
      }
      z -= z / i;
    }
  }
  if (n > 1) {
    z -= z / n;
  }
  return z;
}
long long fact[mx];
long long nCr(long long n, long long r) {
  if (r > n || r < 0) return 0;
  long long z = fact[n];
  z = mul(z, powm(fact[n - r], mod - 2));
  z = mul(z, powm(fact[r], mod - 2));
  return z;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m, x, y;
  cin >> n >> m;
  if (n == 7) {
    vector<long long> a[8];
    for (long long i = 0; i < m; i++) {
      cin >> x >> y;
      if (x > y) swap(x, y);
      a[x].push_back(y);
    }
    long long ans = 0;
    for (long long i = 1; i < 7; i++) {
      long long b[8];
      for (long long x = 1; x < 8; x++) {
        b[x] = i;
        for (long long k = 1; k < 8; k++) {
          if (k < x)
            b[k] = k;
          else if (k > x)
            b[k] = k - 1;
        }
        long long z = 0;
        map<pair<long long, long long>, long long> mp;
        for (long long j = 1; j < 8; j++) {
          for (long long k = 0; k < ((long long)a[j].size()); k++) {
            if (mp[{((b[j] > b[a[j][k]]) ? b[a[j][k]] : b[j]),
                    ((b[j] > b[a[j][k]]) ? b[j] : b[a[j][k]])}] == 0)
              z++;
            mp[{((b[j] > b[a[j][k]]) ? b[a[j][k]] : b[j]),
                ((b[j] > b[a[j][k]]) ? b[j] : b[a[j][k]])}]++;
          }
        }
        ans = ((ans > z) ? ans : z);
      }
    }
    cout << ans;
  } else
    cout << m;
  return 0;
}
