#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> adj[8];
int v[8];
int solve(int i) {
  if (i > n) {
    bool mat[8][8];
    memset(mat, false, sizeof mat);
    for (int j = 1; j <= n; j++) {
      for (int c : adj[j]) {
        if (!mat[v[j]][v[c]]) mat[v[c]][v[j]] = true;
      }
    }
    int ans = 0;
    for (int j = 1; j <= 6; j++) {
      for (int k = 1; k <= 6; k++) {
        ans += mat[j][k] ? 1 : 0;
      }
    }
    return ans;
  }
  int ans = 0;
  for (int j = 1; j <= 6; j++) {
    v[i] = j;
    ans = max(ans, solve(i + 1));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  cout << solve(1) << endl;
}
