#include <bits/stdc++.h>
using namespace std;
const int LEN = (int)7;
int n, m;
vector<int> g[LEN];
int color[LEN];
bool f[LEN][LEN];
int solve(int u) {
  color[u] = LEN + 1;
  int ans = 0;
  if (u < n - 1) ans = solve(u + 1);
  for (color[u] = 0; color[u] < 6; color[u]++) {
    vector<pair<int, int>> ch;
    for (auto v : g[u])
      if (color[v] < 6 && !f[color[u]][color[v]]) {
        ch.push_back(make_pair(color[u], color[v]));
        f[color[u]][color[v]] = true;
        f[color[v]][color[u]] = true;
      }
    if (u == n - 1) {
      int curr = 0;
      for (int i = 0; i < LEN; i++)
        for (int j = i; j < LEN; j++) curr += f[i][j];
      ans = max(ans, curr);
    } else {
      ans = max(ans, solve(u + 1));
    }
    for (auto it : ch) {
      f[it.first][it.second] = false;
      f[it.second][it.first] = false;
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  cout << solve(0);
  return 0;
}
