#include <bits/stdc++.h>
using namespace std;
const double pai = acos(-1);
const double eps = 1e-10;
const long long mod = 1e9 + 7;
const int MX = 1e6 + 5;
int n, m;
int mp[10][10];
int vis[10], p[10];
int id[10];
int us[7][7];
int ans = 0;
void dfs(int st, int ii, int jj) {
  if (st == 7) {
    int pos = 0, sum = 0;
    memset(us, 0, sizeof(us));
    for (int i = 1; i < ii; i++) id[i] = p[++pos];
    id[ii] = jj;
    for (int i = ii + 1; i <= 7; i++) id[i] = p[++pos];
    for (int i = 1; i <= 7; i++) {
      for (int j = i + 1; j <= 7; j++) {
        if (mp[i][j] && !us[id[i]][id[j]]) {
          us[id[i]][id[j]] = 1;
          us[id[j]][id[i]] = 1;
          sum++;
        }
      }
    }
    ans = max(ans, sum);
    return;
  }
  for (int i = 1; i <= 6; i++) {
    if (vis[i]) continue;
    p[st] = i;
    vis[i] = 1;
    dfs(st + 1, ii, jj);
    vis[i] = 0;
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int sa, sb;
    scanf("%d %d", &sa, &sb);
    mp[sa][sb] = mp[sb][sa] = 1;
  }
  if (n < 7) {
    cout << m;
    return 0;
  }
  for (int i = 1; i <= 7; i++) {
    for (int j = 1; j <= 6; j++) {
      memset(vis, 0, sizeof(vis));
      dfs(1, i, j);
    }
  }
  cout << ans;
  return 0;
}
