#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> edges;
bool used[7][7];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    if (a > b) swap(a, b);
    edges.push_back({a, b});
  }
  vector<int> id(8);
  iota(id.begin(), id.end(), 0);
  if (n <= 6) {
    cout << m << "\n";
  } else {
    int ans = 0;
    vector<int> perm = id;
    id = perm;
    for (int i = 1; i <= 7; i++) {
      for (int j = 1; j <= 7; j++) {
        id[i] = id[j];
        int counter_id = 1;
        for (int k = 1; k <= 7; k++) {
          if (k == max(i, j))
            id[k] = id[min(i, j)];
          else
            id[k] = counter_id++;
        }
        for (int i = 1; i <= 6; i++) {
          for (int j = 1; j <= 6; j++) {
            used[i][j] = false;
          }
        }
        int cnt = 0;
        for (auto [a, b] : edges) {
          if (id[a] > id[b]) swap(a, b);
          if (!used[id[a]][id[b]]) {
            used[id[a]][id[b]] = true;
            cnt++;
          }
        }
        ans = max(ans, cnt);
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
