#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, ans, s[] = {0, 1, 2, 3, 4, 5, 6, 6};
bool p[10][10], vis[10][10];
int get_sum() {
  memset(vis, false, sizeof(vis));
  int a, b, res = 0;
  for (int i = 1; i <= 7; i++)
    for (int j = 1; j <= 7; j++)
      if (p[i][j]) {
        a = s[i], b = s[j];
        if (!vis[a][b]) {
          res++;
          vis[a][b] = vis[b][a] = true;
        }
      }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    p[x][y] = p[y][x] = true;
  }
  if (n < 7)
    cout << m;
  else {
    while (next_permutation(s + 1, s + 8)) ans = max(ans, get_sum());
    cout << ans;
  }
  return 0;
}
