#include <bits/stdc++.h>
using namespace std;
void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long md = 1000000007;
const long long inf = 1e18L + 5;
const char nl = '\n';
const int N = 200005;
int main() {
  FAST();
  int tt{}, T{};
  tt = 1;
  while (tt--) {
    string str, sa, sb;
    int n{}, m{}, ans{}, k{}, a{}, b{}, c{}, x{}, y{}, f{}, q{};
    cin >> n >> m;
    vector<std::vector<int> > g(n + 1), gg;
    for (int i = 0; i < m; ++i) {
      cin >> x >> y;
      g[x].push_back(y);
      g[y].push_back(x);
    }
    gg = g;
    b = md;
    for (int i = 1; i < min(7, n + 1); ++i) {
      if (g[i].size() < b) {
        b = g[i].size();
        a = i;
      }
    }
    y = 0;
    for (int p = 1; p < 7; ++p) {
      g.clear();
      g = gg;
      ans = 0;
      int zz[8][8]{};
      for (int i = 0; i < 8; ++i) {
        for (int j = 0; j < 8; ++j) zz[i][j] = 0;
      }
      a = p;
      if (n >= 7) {
        for (int i = 1; i < n + 1; ++i) {
          k = g[i].size();
          for (int j = 0; j < k; ++j) {
            if (g[i][j] == a) {
              g[i][j] = 7;
            } else if (g[i][j] == 7) {
              g[i][j] = a;
            }
          }
        }
        std::vector<int> v = g[a];
        g[a].clear();
        for (auto& e : g[7]) g[a].push_back(e);
        g[7].clear();
        for (auto& e : v) g[7].push_back(e);
      }
      ans = 0;
      f = 0;
      int z[8][8]{};
      for (int i = 1; i < min(7, n + 1); ++i) {
        for (auto& j : g[i]) {
          if (j == 7) continue;
          if (!z[i][j] && (!z[j][i])) {
            z[i][j] = z[j][i] = 1;
            ++ans;
          }
        }
      }
      a = 0;
      a = ans;
      ans = 0;
      c = 0;
      if (n >= 7) {
        for (int i = 1; i < 7; ++i) {
          c = 0;
          vector<std::pair<int, int> > w;
          for (auto& e : g[7]) {
            if (z[i][e] == 0 && z[e][i] == 0) {
              z[i][e] = z[e][i] = 1;
              ++c;
              w.push_back(make_pair(i, e));
            }
          }
          for (auto& qq : w) {
            z[qq.first][qq.second] = z[qq.second][qq.first] = 0;
          }
          ans = max(ans, c);
        }
      }
      a += ans;
      y = max(y, a);
    }
    cout << y << nl;
  }
  return 0;
}
