#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  clock_t begin_time = clock();
  int n, m;
  cin >> n >> m;
  vector<int> adj[n];
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int ans = 0;
  if (n < 7) {
    ans = m;
  } else {
    int best = 0;
    for (int last = 0; last < n; ++last) {
      set<pair<int, int>> avai = {
          {1, 1}, {1, 2}, {1, 3}, {1, 4}, {1, 5}, {1, 6}, {2, 2},
          {2, 3}, {2, 4}, {2, 5}, {2, 6}, {3, 3}, {3, 4}, {3, 5},
          {3, 6}, {4, 4}, {4, 5}, {4, 6}, {5, 5}, {5, 6}, {6, 6}};
      vector<int> color(n);
      int last_color = 1;
      for (int j = 0; j < n; ++j) {
        if (j == last) {
          continue;
        }
        if (color[j] == 0) {
          color[j] = last_color;
          last_color++;
        }
        for (auto x : adj[j]) {
          if (x == last) {
            continue;
          }
          if (color[x] == 0) {
            color[x] = last_color;
            last_color++;
          }
          avai.erase({min(color[j], color[x]), max(color[j], color[x])});
        }
      }
      int best_extra_rem = 0;
      for (int col_last = 1; col_last < 7; ++col_last) {
        int extra_rem = 0;
        for (auto x : adj[last]) {
          if (avai.count({min(col_last, color[x]), max(col_last, color[x])})) {
            extra_rem += 1;
          }
        }
        if (extra_rem > best_extra_rem) {
          best_extra_rem = extra_rem;
        }
      }
      int curr = 21 - avai.size() + best_extra_rem;
      if (curr > best) {
        best = curr;
      }
    }
    ans = best;
  }
  cout << ans << "\n";
  clock_t end_time = clock();
  double elapsed_secs = double(end_time - begin_time) / CLOCKS_PER_SEC;
  cerr << "Exec time: " << elapsed_secs << " s" << endl;
}
