#include <bits/stdc++.h>
using namespace std;
long long const INF = 1000000000;
const int MOD = 1e9 + 7;
const int N = 2e5 + 500;
void SpeedForce() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int simple(int n) {
  int i, sq;
  if (n % 2 == 0) {
    return 0;
  }
  sq = (int)sqrt(n);
  for (i = 3; i <= sq; i++) {
    if ((n % i) == 0) {
      return 0;
    }
  }
  return 1;
}
long long gcd(long long a, long long b) {
  if (a > b) swap(a, b);
  if (!a) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long is_prime(long long n) {
  if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0)) return 0;
  for (long long i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
    if (n % i == 0) return 0;
  return 1;
}
long long binpow(long long x, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2) {
      res = (res * x) % MOD;
    }
    x = (x * x) % MOD;
    n /= 2;
  }
  return res;
}
vector<int> g[N];
bool du[10][10];
int ans = -1;
int n, m;
int col[10];
void find(int x, int res) {
  if (x == n) {
    if (res > ans) {
      ans = res;
    }
    return;
  }
  vector<pair<int, int>> rm;
  for (int i = 0; i < 6; ++i) {
    col[x] = i;
    rm.clear();
    for (int v : g[x]) {
      if (v < x && !du[col[x]][col[v]]) {
        rm.emplace_back(col[x], col[v]);
        du[col[x]][col[v]] = true;
        du[col[v]][col[x]] = true;
      }
    }
    find(x + 1, res + rm.size());
    for (auto& pop_back : rm) {
      du[pop_back.first][pop_back.second] = false;
      du[pop_back.second][pop_back.first] = false;
    }
  }
}
void solve() {
  cin >> n >> m;
  int u, v;
  for (int i = 0; i < m; ++i) {
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 0; i < 6; ++i) {
    for (int j = 0; j < 6; ++j) {
      du[i][j] = false;
    }
  }
  col[0] = 0;
  find(1, 0);
  cout << ans << "\n";
}
int main() {
  SpeedForce();
  int T = 1;
  while (T--) {
    solve();
  }
}
