#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<pair<int, int>> edges;
bool used[10][10];
void gen(int cur, int lim, vector<int> at = {}) {
  if (cur == lim) {
    g.push_back(at);
  } else {
    for (int i = 1; i <= 6; ++i) {
      at.push_back(i);
      gen(cur + 1, lim, at);
      at.pop_back();
    }
  }
}
long long solve(vector<int>& order) {
  memset(used, 0, sizeof used);
  int ans = 0;
  for (auto [u, v] : edges) {
    int a = order[u], b = order[v];
    if (a > b) swap(a, b);
    if (!used[a][b]) {
      used[a][b] = 1;
      ++ans;
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    edges.emplace_back(u, v);
  }
  gen(0, n);
  long long ans = 0;
  for (auto cand : g) {
    ans = max(ans, solve(cand));
  }
  cout << ans << endl;
  return 0;
}
