#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5 + 500;
const long long INF = 1e9 + 7;
vector<int> g[MAX_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& pp : rm) {
      du[pp.first][pp.second] = false;
      du[pp.second][pp.first] = false;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  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";
  return 0;
}
